Hi all,
I want to make a contout plot with a slider element. But I am not sure if it
is possible at all and if it is possible how.
The code is a mixture of two examples I found in the web. One part is the
slider example of matplotlib
> from pylab import *
>
> N = 50
> x = linspace(.0, 1.0, N)
> y = linspace(.0, 1.0, N)
> X, Y = meshgrid(x, y)
> Z = sin(X+16) - 2*cos(Y*5.2)
> c = contourf(X, Y, Z,20)
> colorbar()
>
> # Copied from the slider example ... not sure about the syntax
> axfreq = axes([0.25, 0.1, 0.65, 0.03])
> sfreq = Slider(axfreq, 'Amp', 0.1, 10.0, valinit=1)
> def update(val):
> global sfreq
> freq = sfreq.val
> Z = sin(freq*X+16) - 2*cos(Y*5.2)
> c.set_data(Z) # Is something like that possible
> draw()
> sfreq.on_changed(update)
> show()
>
I tried different stuff, but could not solve the problem. Perhaps anybody
has an idea to help me.
Thank you!
Best regards
Stefan
--
View this message in context:
http://old.nabble.com/Contour-Contourf-dynamically-with-slider-tp30698071p30698071.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users