It's not obvious to me that this is wrong. The path has a MOVETO command (1) in the middle, and thus should require the creation of two polygons. Can you provide some code or pictures that demonstrate the problem?
Mike On 01/13/2011 05:54 PM, Lionel Roubeyrie wrote: > Hi all, > Using the last 1.0.1 matplotlib version,sometimes exporting paths to > polygons gives wrong results like here (paths come from a > tricontourset) : > In [94]: path > Out[94]: > Path([[ 172.0079229 -43.79390934] > [ 171.97660793 -43.785 ] > [ 171.96206864 -43.78273625] > [ 171.959 -43.78114859] > ... > [ 171.593 -44.00678244] > [ 171.64906502 -44.01 ] > [ 171.654 -44.01077106] > [ 171.7068607 -44.0160044 ]], [1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 > 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2]) > In [95]: path.vertices.shape > Out[95]: (210, 2) > > but to_polygons gives another result : > In [98]: path.to_polygons() > Out[98]: > [array([[ 172.0079229 , -43.79390934], > [ 171.86039224, -43.65 ], > [ 172.081 , -43.54450289], > [ 172.386 , -43.57010293], > [ 172.60631978, -43.67753099], > [ 172.59231502, -43.71219961], > [ 172.325 , -43.78095532], > [ 172.02 , -43.79497729]]), > array([[ 171.715 , -44.0160044 ], > [ 173.02676111, -43.92 ], > [ 172.935 , -43.53340591], > [ 171.40281884, -43.70029758], > [ 171.37760645, -43.94389688], > [ 171.54044973, -44.0037666 ], > [ 171.7068607 , -44.0160044 ], > [ 171.7068607 , -44.0160044 ]])] > > Cheers > > -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel