From: <jd...@us...> - 2008-05-28 18:03:26
|
Revision: 5292 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5292&view=rev Author: jdh2358 Date: 2008-05-28 11:03:15 -0700 (Wed, 28 May 2008) Log Message: ----------- added keywords to configure sliders for sf patch 1866207 Modified Paths: -------------- branches/v0_91_maint/CHANGELOG branches/v0_91_maint/examples/logo.py branches/v0_91_maint/examples/widgets/sliders.py branches/v0_91_maint/lib/matplotlib/widgets.py Modified: branches/v0_91_maint/CHANGELOG =================================================================== --- branches/v0_91_maint/CHANGELOG 2008-05-28 17:00:15 UTC (rev 5291) +++ branches/v0_91_maint/CHANGELOG 2008-05-28 18:03:15 UTC (rev 5292) @@ -1,3 +1,8 @@ +2008-05-28 Allow keyword args to configure widget properties as + requested in + http://sourceforge.net/tracker/index.php?func=detail&aid=1866207&group_id=80706&atid=560722 + - JDH + 2008-05-28 Fix rendering of composite glyphs in Type 3 conversion (particularly as evidenced in the Eunjin.ttf Korean font) Thanks Jae-Joon Lee for finding this! Modified: branches/v0_91_maint/examples/logo.py =================================================================== --- branches/v0_91_maint/examples/logo.py 2008-05-28 17:00:15 UTC (rev 5291) +++ branches/v0_91_maint/examples/logo.py 2008-05-28 18:03:15 UTC (rev 5292) @@ -8,7 +8,7 @@ file('data/membrane.dat', 'rb').read(), float32) # 0.0005 is the sample interval t = 0.0005*arange(len(x)) -figure(1, figsize=(7,1), dpi=100) +figure(1, figsize=(4,1), dpi=70) ax = subplot(111, axisbg='y') plot(t, x) text(0.5, 0.5,'matplotlib', color='r', @@ -20,5 +20,5 @@ axis([1, 1.72,-60, 10]) setp(gca(), 'xticklabels', []) setp(gca(), 'yticklabels', []) -#savefig('logo2.png', dpi=300) +savefig('logo2.png', dpi=70) show() Modified: branches/v0_91_maint/examples/widgets/sliders.py =================================================================== --- branches/v0_91_maint/examples/widgets/sliders.py 2008-05-28 17:00:15 UTC (rev 5291) +++ branches/v0_91_maint/examples/widgets/sliders.py 2008-05-28 18:03:15 UTC (rev 5292) @@ -12,8 +12,8 @@ axfreq = axes([0.125, 0.1, 0.775, 0.03], axisbg=axcolor) axamp = axes([0.125, 0.15, 0.775, 0.03], axisbg=axcolor) -sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=1) -samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=1) +sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=1, facecolor='blue', alpha=0.5) +samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=1, facecolor='red', alpha=0.5) def update(val): amp = samp.val Modified: branches/v0_91_maint/lib/matplotlib/widgets.py =================================================================== --- branches/v0_91_maint/lib/matplotlib/widgets.py 2008-05-28 17:00:15 UTC (rev 5291) +++ branches/v0_91_maint/lib/matplotlib/widgets.py 2008-05-28 18:03:15 UTC (rev 5292) @@ -171,7 +171,7 @@ """ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f', closedmin=True, closedmax=True, slidermin=None, slidermax=None, - dragging=True): + dragging=True, **kwargs): """ Create a slider from valmin to valmax in axes ax; @@ -185,6 +185,11 @@ slidermin and slidermax - be used to contrain the value of this slider to the values of other sliders. + + additional kwargs are passed on to self.poly which is the + matplotlib.patches.Rectangle which draws the slider. See the + matplotlib.patches.Rectangle documentation for legal property + names (eg facecolor, edgecolor, alpha, ...) """ self.ax = ax @@ -192,7 +197,7 @@ self.valmax = valmax self.val = valinit self.valinit = valinit - self.poly = ax.axvspan(valmin,valinit,0,1) + self.poly = ax.axvspan(valmin,valinit,0,1, **kwargs) self.vline = ax.axvline(valinit,0,1, color='r', lw=1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |