SF.net SVN: matplotlib:[7866] branches/v0_99_maint/lib/matplotlib/artist.py
Revision: 7866 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7866&view=rev Author: astraw Date: 2009-10-11 18:54:22 + (Sun, 11 Oct 2009) Log Message: --- allow already transformed clip path in artist set_clip_path() Modified Paths: -- branches/v0_99_maint/lib/matplotlib/artist.py Modified: branches/v0_99_maint/lib/matplotlib/artist.py === --- branches/v0_99_maint/lib/matplotlib/artist.py 2009-10-11 02:55:42 UTC (rev 7865) +++ branches/v0_99_maint/lib/matplotlib/artist.py 2009-10-11 18:54:22 UTC (rev 7866) @@ -484,6 +484,9 @@ elif isinstance(path, Path): self._clippath = TransformedPath(path, transform) success = True +elif isinstance(path, TransformedPath): +self._clippath = path +success = True if not success: print type(path), type(transform) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[7867] branches/v0_99_maint/lib/matplotlib/axes.py
Revision: 7867 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7867&view=rev Author: astraw Date: 2009-10-11 18:55:18 + (Sun, 11 Oct 2009) Log Message: --- imshow: only apply axes patch clipping if image doesn't clip itself Modified Paths: -- branches/v0_99_maint/lib/matplotlib/axes.py Modified: branches/v0_99_maint/lib/matplotlib/axes.py === --- branches/v0_99_maint/lib/matplotlib/axes.py 2009-10-11 18:54:22 UTC (rev 7866) +++ branches/v0_99_maint/lib/matplotlib/axes.py 2009-10-11 18:55:18 UTC (rev 7867) @@ -6275,7 +6275,9 @@ im.set_data(X) im.set_alpha(alpha) self._set_artist_props(im) -im.set_clip_path(self.patch) +if not im.get_clip_on(): +# image does not already have clipping set, clip to axes patch +im.set_clip_path(self.patch) #if norm is None and shape is None: #im.set_clim(vmin, vmax) if vmin is not None or vmax is not None: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[7868] trunk/matplotlib
Revision: 7868 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7868&view=rev Author: astraw Date: 2009-10-11 19:03:14 + (Sun, 11 Oct 2009) Log Message: --- Merged revisions 7866-7867 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint r7866 | astraw | 2009-10-11 11:54:22 -0700 (Sun, 11 Oct 2009) | 2 lines allow already transformed clip path in artist set_clip_path() r7867 | astraw | 2009-10-11 11:55:18 -0700 (Sun, 11 Oct 2009) | 2 lines imshow: only apply axes patch clipping if image doesn't clip itself Modified Paths: -- trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/axes.py Property Changed: trunk/matplotlib/ trunk/matplotlib/doc/pyplots/README trunk/matplotlib/doc/sphinxext/gen_gallery.py trunk/matplotlib/doc/sphinxext/gen_rst.py trunk/matplotlib/examples/misc/multiprocess.py trunk/matplotlib/examples/mplot3d/contour3d_demo.py trunk/matplotlib/examples/mplot3d/contourf3d_demo.py trunk/matplotlib/examples/mplot3d/polys3d_demo.py trunk/matplotlib/examples/mplot3d/scatter3d_demo.py trunk/matplotlib/examples/mplot3d/surface3d_demo.py trunk/matplotlib/examples/mplot3d/wire3d_demo.py trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_spines/spines_axes_positions.png Property changes on: trunk/matplotlib ___ Modified: svnmerge-integrated - /branches/mathtex:1-7263 /branches/v0_99_maint:1-7864 + /branches/mathtex:1-7263 /branches/v0_99_maint:1-7867 Modified: svn:mergeinfo - /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864 + /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864,7866-7867 Property changes on: trunk/matplotlib/doc/pyplots/README ___ Modified: svn:mergeinfo - /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,7727-7734,7740-7741,7745,7751,7756,7762,7770,7772,7774,7776-7778,7780,7784,7788,7790,7792,7794,7796,7800,7803,7808,7822,7827,7834,7837,7844,7846-7847,7849,7858,7864 + /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245 /branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703,772
SF.net SVN: matplotlib:[7869] trunk/matplotlib/lib/matplotlib/tests/ test_axes.py
Revision: 7869
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7869&view=rev
Author: astraw
Date: 2009-10-11 19:08:32 + (Sun, 11 Oct 2009)
Log Message:
---
testing: add test_axes.test_imshow()
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/tests/test_axes.py
Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py
===
--- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-10-11 19:03:14 UTC
(rev 7868)
+++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-10-11 19:08:32 UTC
(rev 7869)
@@ -364,6 +364,22 @@
ax.plot(x, y)
fig.savefig('nonfinite_limits')
+...@image_comparison(baseline_images=['imshow'])
+def test_imshow():
+#Create a NxN image
+N=100
+(x,y) = np.indices((N,N))
+x -= N/2
+y -= N/2
+r = np.sqrt(x**2+y**2-x*y)
+
+#Create a contour plot at N/4 and extract both the clip path and transform
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+ax.imshow(r)
+fig.savefig('imshow')
+
if __name__=='__main__':
import nose
nose.runmodule(argv=['-s','--with-doctest'], exit=False)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[7870] trunk/matplotlib/lib/matplotlib/tests/ test_axes.py
Revision: 7870
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7870&view=rev
Author: astraw
Date: 2009-10-11 19:09:30 + (Sun, 11 Oct 2009)
Log Message:
---
testing: add test_imshow_clip() based on report by Gellule Xg
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/tests/test_axes.py
Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py
===
--- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-10-11 19:08:32 UTC
(rev 7869)
+++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-10-11 19:09:30 UTC
(rev 7870)
@@ -380,6 +380,34 @@
ax.imshow(r)
fig.savefig('imshow')
+...@image_comparison(baseline_images=['imshow_clip'])
+def test_imshow_clip():
+# As originally reported by Gellule Xg
+
+#Create a NxN image
+N=100
+(x,y) = np.indices((N,N))
+x -= N/2
+y -= N/2
+r = np.sqrt(x**2+y**2-x*y)
+
+#Create a contour plot at N/4 and extract both the clip path and transform
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+c = ax.contour(r,[N/4])
+x = c.collections[0]
+clipPath = x.get_paths()[0]
+clipTransform = x.get_transform()
+
+from matplotlib.transforms import TransformedPath
+clip_path = TransformedPath(clipPath, clipTransform)
+
+#Plot the image clipped by the contour
+ax.imshow(r, clip_path=clip_path)
+fig.savefig('imshow_clip')
+
+
if __name__=='__main__':
import nose
nose.runmodule(argv=['-s','--with-doctest'], exit=False)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[7871] trunk/matplotlib/lib/matplotlib/testing/ decorators.py
Revision: 7871 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7871&view=rev Author: astraw Date: 2009-10-11 19:10:30 + (Sun, 11 Oct 2009) Log Message: --- testing: allow limiting of known failure to known exception class Modified Paths: -- trunk/matplotlib/lib/matplotlib/testing/decorators.py Modified: trunk/matplotlib/lib/matplotlib/testing/decorators.py === --- trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-11 19:09:30 UTC (rev 7870) +++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-11 19:10:30 UTC (rev 7871) @@ -7,7 +7,7 @@ import numpy as np from matplotlib.testing.compare import comparable_formats, compare_images -def knownfailureif(fail_condition, msg=None): +def knownfailureif(fail_condition, msg=None, known_exception_class=None ): """ Assume a will fail if *fail_condition* is True. *fail_condition* @@ -15,6 +15,9 @@ *msg* is the error message displayed for the test. +If *known_exception_class* is not None, the failure is only known +if the exception is an instance of this class. (Default = None) + """ # based on numpy.testing.dec.knownfailureif if msg is None: @@ -27,8 +30,12 @@ try: # Always run the test (to generate images). result = f(*args, **kwargs) -except: +except Exception, err: if fail_condition: +if known_exception_class is not None: +if not isinstance(err,known_exception_class): +# This is not the expected exception +raise # (Keep the next ultra-long comment so in shows in console.) raise KnownFailureTest(msg) # An error here when running nose means that you don't have the matplotlib.testing.noseclasses:KnownFailure plugin in use. else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[7872] trunk/matplotlib/lib/matplotlib/testing/ decorators.py
Revision: 7872
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7872&view=rev
Author: astraw
Date: 2009-10-11 19:11:16 + (Sun, 11 Oct 2009)
Log Message:
---
testing: raise errors that are not real known failures on image comparison
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/testing/decorators.py
Modified: trunk/matplotlib/lib/matplotlib/testing/decorators.py
===
--- trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-11
19:10:30 UTC (rev 7871)
+++ trunk/matplotlib/lib/matplotlib/testing/decorators.py 2009-10-11
19:11:16 UTC (rev 7872)
@@ -97,7 +97,8 @@
else:
fail_msg = 'No failure expected'
will_fail = not (is_comparable and have_baseline_image)
-@knownfailureif(will_fail, fail_msg )
+@knownfailureif(will_fail, fail_msg,
+known_exception_class=ImageComparisonFailure )
def decorated_compare_images():
# set the default format of savefig
matplotlib.rc('savefig', extension=extension)
@@ -109,6 +110,9 @@
finally:
os.chdir(old_dir)
for actual,expected in zip(actual_fnames,expected_fnames):
+if not os.path.exists(expected):
+raise ImageComparisonFailure(
+'image does not exist: %s'%expected)
# compare the images
tol=1e-3 # default tolerance
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[7873] trunk/matplotlib/lib/matplotlib/testing/ compare.py
Revision: 7873
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7873&view=rev
Author: jouni
Date: 2009-10-12 05:41:42 + (Mon, 12 Oct 2009)
Log Message:
---
Raise ImageComparisonFailure instead of NotImplementedError if unable to
convert images
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/testing/compare.py
Modified: trunk/matplotlib/lib/matplotlib/testing/compare.py
===
--- trunk/matplotlib/lib/matplotlib/testing/compare.py 2009-10-11 19:11:16 UTC
(rev 7872)
+++ trunk/matplotlib/lib/matplotlib/testing/compare.py 2009-10-12 05:41:42 UTC
(rev 7873)
@@ -4,6 +4,7 @@
#===
import matplotlib
+from matplotlib.testing.noseclasses import ImageComparisonFailure
import math
import operator
import os
@@ -105,7 +106,7 @@
'''
base, extension = filename.rsplit('.', 1)
if extension not in converter:
- raise NotImplementedError, "Don't know how to convert %s files to png" %
extension
+ raise ImageComparisonFailure, "Don't know how to convert %s files to
png" % extension
newname = base + '_' + extension + '.png'
cmd = converter[extension](filename, newname)
pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
