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)
# 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)
freq = sfreq.val
Z = sin(freq*X+16) - 2*cos(Y*5.2)
c.set_data(Z) # Is something like that possible
I tried different stuff, but could not solve the problem. Perhaps anybody
has an idea to help me.
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.