Revision: 7091
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7091&view=rev
Author: leejjoon
Date: 2009-05-07 03:51:41 +0000 (Thu, 07 May 2009)
Log Message:
-----------
added examples/misc/rasterization_demo.py
Added Paths:
-----------
trunk/matplotlib/examples/misc/rasterization_demo.py
Added: trunk/matplotlib/examples/misc/rasterization_demo.py
===================================================================
--- trunk/matplotlib/examples/misc/rasterization_demo.py
(rev 0)
+++ trunk/matplotlib/examples/misc/rasterization_demo.py 2009-05-07
03:51:41 UTC (rev 7091)
@@ -0,0 +1,53 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+d = np.arange(100).reshape(10, 10)
+x, y = np.meshgrid(np.arange(11), np.arange(11))
+
+theta = 0.25*np.pi
+xx = x*np.cos(theta) - y*np.sin(theta)
+yy = x*np.sin(theta) + y*np.cos(theta)
+
+ax1 = plt.subplot(221)
+ax1.set_aspect(1)
+ax1.pcolormesh(xx, yy, d)
+ax1.set_title("No Rasterization")
+
+ax2 = plt.subplot(222)
+ax2.set_aspect(1)
+ax2.set_title("Rasterization")
+
+m = ax2.pcolormesh(xx, yy, d)
+m.set_rasterized(True)
+
+ax3 = plt.subplot(223)
+ax3.set_aspect(1)
+ax3.pcolormesh(xx, yy, d)
+ax3.text(0.5, 0.5, "Text", alpha=0.2,
+ va="center", ha="center", size=50, transform=ax3.transAxes)
+
+ax3.set_title("No Rasterization")
+
+
+ax4 = plt.subplot(224)
+ax4.set_aspect(1)
+m = ax4.pcolormesh(xx, yy, d)
+m.set_zorder(-20)
+
+ax4.text(0.5, 0.5, "Text", alpha=0.2,
+ zorder=-15,
+ va="center", ha="center", size=50, transform=ax4.transAxes)
+
+ax4.set_rasterization_zorder(-10)
+
+ax4.set_title("Rasterization z$<-10$")
+
+
+# ax2.title.set_rasterized(True) # should display a warning
+
+plt.savefig("test_rasterization.pdf", dpi=150)
+plt.savefig("test_rasterization.eps", dpi=150)
+
+if not plt.rcParams["text.usetex"]:
+ plt.savefig("test_rasterization.svg", dpi=150)
+ # svg backend currently ignores the dpi
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins