>> This is a bug report for matplotlib version 0.99.1.1 >> >> The clip_path keyword of imshow() does not work when setting it to >> (Path, Transform) for two reasons: > > Hi, Thanks for the report. Do you have a simple test script that we can > use to see the problem and then fix it? We will then use this as the > basis to create a test function to make sure the issue never "crops" up > again. > > -Andrew
Hi Andrew, Please try the following. It's a script that clips an NxN image based on its contour. Thanks, -Julien import numpy import pylab #Create a NxN image N=100 (x,y) = numpy.indices((N,N)) x -= N/2 y -= N/2 r = numpy.sqrt(x**2+y**2-x*y) #Create a contour plot at N/4 and extract both the clip path and transform c=pylab.contour(r,[N/4]) clipPath = c.collections[0].get_paths()[0] clipTransform = c.collections[0].get_transform() #Plot the image clipped by the contour pylab.imshow(r, clip_path=(clipPath,clipTransform)) pylab.show() ------------------------------------------------------------------------------ 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-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel