Revision: 8042
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8042&view=rev
Author:   astraw
Date:     2009-12-21 00:45:55 +0000 (Mon, 21 Dec 2009)

Log Message:
-----------
spines: new example

Modified Paths:
--------------
    trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py

Modified: trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py    
2009-12-20 08:03:40 UTC (rev 8041)
+++ trunk/matplotlib/examples/pylab_examples/spine_placement_demo.py    
2009-12-21 00:45:55 UTC (rev 8042)
@@ -113,4 +113,34 @@
 ax.plot(x,y)
 adjust_spines(ax,['bottom'])
 
+# ----------------------------------------------------
+
+fig = plt.figure()
+
+x = np.linspace(0,2*np.pi,50)
+y = np.sin(x)
+y2 = y + 0.1*np.random.normal( size=x.shape )
+
+# plot data
+ax = fig.add_subplot(1,1,1)
+line1,=ax.plot(x,y,'--')
+line2,=ax.plot(x,y2,'bo')
+
+# adjust the spines
+adjust_spines(ax,['left','bottom'])
+
+# set ticks and tick labels
+#   x
+ax.set_xlim((0,2*np.pi))
+ax.set_xticks([0,np.pi,2*np.pi])
+pichr = unichr(0x03C0)
+ax.set_xticklabels(['0',pichr,'2 '+pichr])
+
+#   y
+ax.set_yticks([-1,0,1])
+
+# disable clipping of data points by axes range
+for artist in (line1,line2):
+    artist.set_clip_on(False)
+
 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 Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to