I want to show a multi-variable Manipulate
plot with the current and last setting together but not using Bookmarks
as I want to show both plots. Is there a way to capture the previous variable values and plot the line for the old values. My attempt does not update the last values.
Manipulate[Plot[{Sin[a x + b], Sin[lasta x + lastb]} , {x, -2 Pi, 2 Pi},
PlotLabel -> Style["ai ="<>ToString[a]<>", bi ="<>ToString[b]<>
"\n a(i-1) ="<>ToString[lasta]<>", b(i-1) ="<>ToString[lastb], 20]],
{a, 0, 5} , {b, 0, \[Pi]}, SynchronousUpdating -> False,
Initialization :> {lasta = a; lastb = b;}]
This is what I want to achieve ...
Thanks to @belisarius's code here is the persistence view (see code in comments). Could reduce number of lines by using last n
added using [[-n;;]]
in the plot. Could also add a Reset button see "Reset" Button for Manipulate as Button["Reset", r = {{-5, 0}}]