0
$\begingroup$

How to use Manipulate[] to make a point move vertically and become an outlier? Here I am trying to make $50$-th point move vertically.I have tried as below:

n = 100;
data3 = Table[{t, t^2 + 0.4 RandomReal[]}, {t, 0.0, 10.0, 10/n}];
Print [data3];
point = Part[data3, 50];
Manipulate[ListPlot[data3], {data3[[1]], 0.0, 10}];
$\endgroup$
  • 1
    $\begingroup$ Manipulate[ListPlot[ReplacePart[data3, {50, 2} -> i]], {i, 0.0, 100}] Is that what you want? $\endgroup$ – N.J.Evans Mar 1 '16 at 21:45
  • $\begingroup$ n = 100; data3 = Table[{t, t^2 + 0.4 RandomReal[]}, {t, 0.0, 10.0, 10/n}]; Print [data3]; point = Part[data3, 50]; Manipulate[ListPlot[ReplacePart[data3, {50, 2} -> i]], {i, 0.0, 100}]; may be ,.....but its not printing anything....the plot etc $\endgroup$ – kranthi kumar Mar 1 '16 at 21:47
  • $\begingroup$ You need to get rid of the ; after your manipulate, it's suppressing the output. $\endgroup$ – N.J.Evans Mar 1 '16 at 21:49
  • $\begingroup$ Yes...It works..Thank you. :D $\endgroup$ – kranthi kumar Mar 2 '16 at 0:51
  • $\begingroup$ hi N.J.Evans......can you help me with this question...an extension to current one.mathematica.stackexchange.com/questions/109151/… $\endgroup$ – kranthi kumar Mar 5 '16 at 7:54
0
$\begingroup$

Thanks to the comment by @N.J.Evans above:

Manipulate[ListPlot[ReplacePart[data3, {50, 2} -> i]], {i, 0.0, 100}]
$\endgroup$
  • 2
    $\begingroup$ Consider acknowledging in this answer the comment by @N.J.Evans. $\endgroup$ – bbgodfrey Mar 2 '16 at 1:25
  • $\begingroup$ Yes...Thank you N.J.Evans for the answer.. and Thank you bbgodfrey for your suggestion .... $\endgroup$ – kranthi kumar Mar 2 '16 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.