Looking at the slider_demo.py
, the author has the following code:
axcolor = 'lightgoldenrodyellow'
axfreq = plt.axes([0.25, 0.1, 0.65, 0.03], facecolor=axcolor)
axamp = plt.axes([0.25, 0.15, 0.65, 0.03], facecolor=axcolor)
sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=f0, valstep=delta_f)
samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=a0)
where, in sfreq
, for example, the values 0.1
and 30.0
are valmin
and valmax
, respectively, and the slider values are incremented by delta_f
.
I would like to, instead, define an array of values
valarray = [0.1, 1, 3, 5, 15, 20, 27, 30]
where this array of values are the only values selected, displayed, or available as one moves the slider. This does not appear to be an explicit option for this widget.
It would also be helpful, but not necessary, that I am able to update this list dynamically.
Thanks in advance for your help and assistance.