is this a fill bug?

the command fill(x,y), where x,y are:

In [274]: x,y
Out[274]:
([-9. ,-9. ,-8. ,-8. ,-9. ,-9. ,-8.7659284,
      -8.7659284,-8.7645363,-8.6595349,-8.649452 ,-8.6487604,-8.647775 ,
      -8.6458589,-8.6474525,-8.5967471,-8.4710347,-8.4494473,-8.3825453,
      -8.2483344,-8.0963785,-8.1251909,-8.2621139,-8.2901728,-8.2729088,
      -8.2487353,-8.3169042,-8.3374447,-8.3708706,-8.486742 ,-8.4865633,
      -8.5783225,-8.6306292,-8.7659284,],
[ 40.506093, 41.2 , 41.2 , 40.2 , 40.2 , 40.506093, 40.506093,
       40.506093, 40.578751, 40.923346, 40.970168, 40.978045, 40.986113,
       40.995789, 41.004918, 41.016188, 41.026401, 41.047271, 41.003575,
       41.057014, 40.980312, 40.929052, 40.780916, 40.667243, 40.604054,
       40.510189, 40.491699, 40.427127, 40.340239, 40.289163, 40.332598,
       40.417435, 40.435353, 40.506093,])

was supposed to fill outside some polygon (it does with matlab)
With matplotlib it fills all including the inside the polygon!!
Can someone tell me fill(x,y) is not working in this case as with matlab ?

Thanks

Dear Martinho,

"fill" is just a thin wrapper around matplotlib.patches.Polygon, which is just a thin wrapper around the backend's draw polygon functionality. It appears that Agg, at least, fills in the inside of the shape you've drawn. The matplotlib developers should probably incorporate some sort of triangulation algorithm so that polygons such as yours get drawn properly. In the meantime, perhaps you're interested in such an algorithm yourself: http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html

Cheers!
Andrew

Martinho MA wrote:

···

the command fill(x,y), where x,y are:

In [274]: x,y
Out[274]:
([-9. ,-9. ,-8. ,-8. ,-9. ,-9. ,-8.7659284,
     -8.7659284,-8.7645363,-8.6595349,-8.649452 ,-8.6487604,-8.647775 ,
     -8.6458589,-8.6474525,-8.5967471,-8.4710347,-8.4494473,-8.3825453,
     -8.2483344,-8.0963785,-8.1251909,-8.2621139,-8.2901728,-8.2729088,
     -8.2487353,-8.3169042,-8.3374447,-8.3708706,-8.486742 ,-8.4865633,
     -8.5783225,-8.6306292,-8.7659284,],
[ 40.506093, 41.2 , 41.2 , 40.2 , 40.2 , 40.506093, 40.506093,
      40.506093, 40.578751, 40.923346, 40.970168, 40.978045, 40.986113,
      40.995789, 41.004918, 41.016188, 41.026401, 41.047271, 41.003575,
      41.057014, 40.980312, 40.929052, 40.780916, 40.667243, 40.604054,
      40.510189, 40.491699, 40.427127, 40.340239, 40.289163, 40.332598,
      40.417435, 40.435353, 40.506093,])

was supposed to fill outside some polygon (it does with matlab)
With matplotlib it fills all including the inside the polygon!!
Can someone tell me fill(x,y) is not working in this case as with matlab ?

Thanks

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options