Revision: 5310
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5310&view=rev
Author: jdh2358
Date: 2008-05-29 14:12:59 -0700 (Thu, 29 May 2008)
Log Message:
-----------
added demo showing how to use curvy paths directly
Added Paths:
-----------
trunk/matplotlib/examples/api/path_patch_demo.py
Added: trunk/matplotlib/examples/api/path_patch_demo.py
===================================================================
--- trunk/matplotlib/examples/api/path_patch_demo.py
(rev 0)
+++ trunk/matplotlib/examples/api/path_patch_demo.py 2008-05-29 21:12:59 UTC
(rev 5310)
@@ -0,0 +1,34 @@
+import numpy as np
+import matplotlib.path as mpath
+import matplotlib.patches as mpatches
+import matplotlib.pyplot as plt
+
+Path = mpath.Path
+
+pathdata = [
+ (Path.MOVETO, (0, 0)),
+ (Path.CURVE4, (-1, 0)),
+ (Path.CURVE4, (-1, 1)),
+ (Path.CURVE4, (0, 1)),
+ (Path.LINETO, (2, 1)),
+ (Path.CURVE4, (3, 1)),
+ (Path.CURVE4, (3, 0)),
+ (Path.CURVE4, (2, 0)),
+ (Path.CLOSEPOLY, (0, 0)),
+ ]
+
+codes, verts = zip(*pathdata)
+path = mpath.Path(verts, codes)
+
+patch = mpatches.PathPatch(path, facecolor='green', edgecolor='yellow',
alpha=0.5)
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.add_patch(patch)
+
+ax.set_xlim(-5,5)
+ax.set_ylim(-5,5)
+
+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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins