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$
5
  • 1
    $\begingroup$ Manipulate[ListPlot[ReplacePart[data3, {50, 2} -> i]], {i, 0.0, 100}] Is that what you want? $\endgroup$
    – N.J.Evans
    Commented Mar 1, 2016 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$ Commented Mar 1, 2016 at 21:47
  • $\begingroup$ You need to get rid of the ; after your manipulate, it's suppressing the output. $\endgroup$
    – N.J.Evans
    Commented Mar 1, 2016 at 21:49
  • $\begingroup$ Yes...It works..Thank you. :D $\endgroup$ Commented Mar 2, 2016 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$ Commented Mar 5, 2016 at 7:54

1 Answer 1

0
$\begingroup$

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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