From: Nicolas <nic...@ya...> - 2007-06-06 20:14:58
|
I can't figure why Polygons are used even when I simply draw lines. But I know at least why I use empty list of vertices. ;) In fact, I use matplotlib for a dynamic geometry software (something like GeoGebra), and systematic use of high-level functions of matplotlib would be to slow for that purpose. And yet, I didn't want to use too low-level functions, like the renderer's ones, for I didn't want to depend too much of a particular renderer. So, I created once a set of plots and fills for every object, and then I modified its attributes . I used to set its vertices to an empty list when I didn't want it to appear on the figure. I suppose now I'd better use instead something like. my_plot._visible = False Nevertheless, I think empty vertices should be supported here (or not supported at all for all renderers - for in 0.90.1 it still works with tkagg for example) Nicolas On 6/6/07, John Hunter <jd...@gm...> wrote: > > On 6/6/07, Nicolas <nic...@ya...> wrote: > > > Unfortunately, I didn't use instantiated Polygon items myself, so for > now I > > can't figure which part of my code produces indirectly such empty > > Polygons... > > > > May it be however possible to modify a little matplotlib code, so as to > > assure the compatibility with the previous existing versions of > matplotlib ? > > Something like : > > I don't have a problem with this, but it just makes it easier for > latent bugs in your code to remain hidden. Should we raise in the > Polygon constructor is you pass in an empty list of vertices? Of > course, you can always set xy directly, so this won't catch all the > errors unless we use properties or traits. > > JDH > |