Revision: 8120
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8120&view=rev
Author: leejjoon
Date: 2010-02-08 17:11:38 +0000 (Mon, 08 Feb 2010)
Log Message:
-----------
update examples/api/demo_affine_image.py
Modified Paths:
--------------
trunk/matplotlib/examples/api/demo_affine_image.py
Modified: trunk/matplotlib/examples/api/demo_affine_image.py
===================================================================
--- trunk/matplotlib/examples/api/demo_affine_image.py 2010-02-08 16:54:31 UTC (rev 8119)
+++ trunk/matplotlib/examples/api/demo_affine_image.py 2010-02-08 17:11:38 UTC (rev 8120)
@@ -30,24 +30,37 @@
if 1:
- ax = plt.subplot(111)
+
+ # image rotation
+
+ ax1 = plt.subplot(121)
Z = get_image()
- im = imshow_affine(ax, Z, interpolation='nearest', cmap=cm.jet,
- origin='lower',
- extent=[-2, 4, -3, 2], clip_on=True)
+ im1 = imshow_affine(ax1, Z, interpolation='nearest', cmap=cm.jet,
+ origin='lower',
+ extent=[-2, 4, -3, 2], clip_on=True)
- trans_data2 = mtransforms.Affine2D().rotate_deg(30) + ax.transData
- im.set_transform(trans_data2)
+ trans_data2 = mtransforms.Affine2D().rotate_deg(30) + ax1.transData
+ im1.set_transform(trans_data2)
# display intended extent of the image
- x1, x2, y1, y2 = im.get_extent()
+ x1, x2, y1, y2 = im1.get_extent()
x3, y3 = x2, y1
- ax.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "r--", lw=3,
- transform=trans_data2)
+ ax1.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "r--", lw=3,
+ transform=trans_data2)
- ax.set_xlim(-3, 5)
- ax.set_ylim(-4, 4)
+ ax1.set_xlim(-3, 5)
+ ax1.set_ylim(-4, 4)
+
+ # image skew
+
+ ax2 = plt.subplot(122)
+ im2 = ax2.imshow(Z, interpolation='nearest', cmap=cm.jet,
+ origin='lower',
+ extent=[-2, 4, -3, 2], clip_on=True)
+ im2._image_skew_coordinate = (3, -2)
+
+
plt.show()
#plt.savefig("demo_affine_image")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|