On Wed, Jan 16, 2013 at 2:42 PM, Todd <toddr...@gmail.com> wrote: > Currently matplotlib uses set_ and get_ functions for reading and writing > values. However, since 2.6 python supports properties, which allow access > to such values as attributes in addition to using the functions directly. > Would it be worthwhile implementing property support in matplotlib? > > This was actually discussed during a Birds of a Feather (BOF) meeting back in SciPy2012 (which John Hunter attended). I am definitely for the idea, but it is going to be a very painful and long deprecation process. A bit of background (at least, my understanding of it)...
In matlab, there is the setp and getp functions. With this, you can set and get properties of various graphing objects. It is this feature that John duplicated, and it is the organic growth from there is why we are where we are now. Furthermore, for those who haven't noticed, we have a strange "alias" feature. For example, one could set edgecolor, but also ec, to the same effect. In a lark, I decided to trace down this feature and, to my horror, discovered how it works. Believe it or not, the docstring for set_edgecolor (or get_edgecolor, I forget) mentions that "ec" is an alias, and there is code elsewhere that processes the docstrings, looking for mentions of aliases, and uses that to guide the setting of properties. Of course, don't forget that sometimes we do the plural of a property name as well... Rather than keeping these attributes as a part of the artist objects, I would rather encapsulate the artist properties using a new Properties class (maybe it subclasses from dict?). This would make it easier to apply/share properties between many objects, and be more future-proof. My 2 cents, Ben Root
------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612
_______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel