def main(): import utils fig = utils.createfig() # MSlider def func_aS(): print aS.get_value() aS = MSlider(fig, [0.3, 0.7, 0.3, 0.03], 'titolo', 1, 100, None, func_aS) aS.set_interval(1e-5, 1e7) # CBox def func_aC(): print aC.get_status() aC = CBox(fig, [0.8, 0.8, 0.1, 0.15], ('a', 'b', 'c'), func=func_aC) # MTxt tdt = ({'x': 0.3, 'y': 0.1, 's': r'$yeah$'}, {'x': 0.1, 'y': 0.8, 's': 'yes', 'fs': 'large'}, ) aT = MTxt(fig, [0.2, 0.8, 0.3, 0.15], tdt, bgc='red', axb=True) # MImage aI = MImage(fig, [0.2, 0.12, 0.6, 0.5], '../img/rc.png') # ButtonA def func_aB(l): print l aB = MButton(fig, [0.1, 0.05, 0.1, 0.05], 'OK', func_aB, ('ok!',)) plt.show()
def main(): from matplotlib import pyplot as plt import utils fig = utils.createfig() a = WSin(fig, [0.1, 0.5, 0.8, 0.3] , nps=5) b = WSin(fig, [0.1, 0.1, 0.8, 0.3], nps=3, om=3) args11 = (dict(k=0, am=1, ph=0, t='v', n='1'), dict(k=-1.5, am=0.1, ph=0.5, t='v', n='3'),) args12 = (dict(k=1,am=2,ph=1,t='i',n='2'),) args13 = (dict(k=100,am=3,ph=2,t='i',n='no',v=False),) args2 = (dict(k=0,am=1,ph=0,t='v',n='1'),dict(k=1,am=2,ph=1,t='i',n='2'), dict(k=-1.5,am=0.1,ph=0,t='v',n='3'),\ dict(k=100,am=3,ph=2,t='i',n='no',v=False),) a.new(100, args11, args12, ()) b.new(101, *args2) #b.set_anim(True) # bottone from matplotlib.widgets import Button box = fig.add_axes([0.05, 0.90, 0.05, 0.05]) but = Button(box, 'next') def func(wtf): #args2 = _r_args(4) #print args2 #b.new(100, *args2) b.set_anim(not b.get_anim()) but.on_clicked(func) plt.show()
def main(): from matplotlib import pyplot as plt import utils fig = utils.createfig() a = SBode(fig, [0.125 ,0.1, 0.7 ,0.6], [10, 0], [1, 1*2*np.pi], 1e-6, 1e6) plt.show()
def main(): from matplotlib import pyplot as plt import utils fig = utils.createfig() a = BjtC(fig, [0.1, 0.2, 0.8, .5], 'BC107') #a.setQ(10.8, 0.0045) #a.draw_ellipse(1, 0, 0.0005,1) #a.setP(11.8, 0.0045 + 0.0005*np.sin(1)) plt.show()