I would like to have a slider controlling a vertical bar on my plot. 
Changing the value of the slider should only move the bar, not replot the 
whole figure. So far I have come up with this code
















*using Reactive, Interactusing PyPlotf = figure();x = 
linspace(0,10,10000000)vertval=slider(0:1:10)replot = button("Replot") # 
Commit your changesmap(display, [vertval, replot]) # optionalcoeffs = 
sampleon(replot, lift(tuple, vertval))@manipulate for val=coeffs; 
withfig(f) do        PyPlot.plot(x, sin(x))        axvline(val[1])    
endend*but, judging by the time it takes it to "replot" I am guessing it 
redraws the whole figure, not just the vertical bar. In this particular 
example this is not such a big problem, but in a real-world example where 
drawing the figure takes a long time it quickly becomes unusable. So the 
idea is to move the *PyPlot.plot(x, sin(x)) *out of the loop somehow, 
without losing the plot and ending up with just the vertical line (this is 
what happens atm). 
Any ideas?

Tnx,
//A

Reply via email to