Revision: 6456
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6456&view=rev
Author: efiring
Date: 2008-11-29 02:20:56 +0000 (Sat, 29 Nov 2008)
Log Message:
-----------
Make scale colors match line colors in two_scales.py
Modified Paths:
--------------
trunk/matplotlib/examples/api/two_scales.py
Modified: trunk/matplotlib/examples/api/two_scales.py
===================================================================
--- trunk/matplotlib/examples/api/two_scales.py 2008-11-26 18:59:58 UTC (rev
6455)
+++ trunk/matplotlib/examples/api/two_scales.py 2008-11-29 02:20:56 UTC (rev
6456)
@@ -30,13 +30,17 @@
s1 = np.exp(t)
ax1.plot(t, s1, 'b-')
ax1.set_xlabel('time (s)')
-ax1.set_ylabel('exp')
+# Make the y-axis label and tick labels match the line color.
+ax1.set_ylabel('exp', color='b')
+for tl in ax1.get_yticklabels():
+ tl.set_color('b')
-# turn off the 2nd axes rectangle with frameon kwarg
ax2 = ax1.twinx()
s2 = np.sin(2*np.pi*t)
ax2.plot(t, s2, 'r.')
-ax2.set_ylabel('sin')
+ax2.set_ylabel('sin', color='r')
+for tl in ax2.get_yticklabels():
+ tl.set_color('r')
plt.show()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins