May-16-2019, 04:52 PM
(This post was last modified: May-16-2019, 05:09 PM by DreamingInsanity.)
I think this question fits more in the GUI forum.
D
Just to answer this anyway, here is what you wanted:
D
D
Just to answer this anyway, here is what you wanted:
import matplotlib.pyplot as plt from pylab import * from matplotlib.widgets import Slider import numpy as np c = 0 a = np.random.random((64, 64)) plt.figure('My First GUI') plt.imshow(a, cmap='gray', interpolation='nearest') axcolor = 'lightgoldenrodyellow' axhte = axes([0.15, 0.04, 0.6, 0.03], facecolor=axcolor) #x,y,w,h axhre = axes([0.15, 0.01, 0.65, 0.03], facecolor=axcolor) sl1 = Slider(axhte, 'Slider1', -90, 90, valinit=1) sl2 = Slider(axhre, 'Slider2', -90, 90, valinit=1) def get_valS1(val): print("value of s1:",sl1.val) def get_valS2(val): print("value of s2:",sl2.val) sl1.on_changed(get_valS1) sl2.on_changed(get_valS2) plt.show()Have a look here to see where I got it from: https://stackoverflow.com/questions/1106...tlib-chart
D