|
From: John H. <jd...@gm...> - 2009-05-29 01:18:31
|
On Wed, May 27, 2009 at 11:33 AM, Andrew Straw <str...@as...> wrote:
> I've gone ahead and committed my arbitrary spine location implementation
> to the trunk (svn r7144). I'd appreciate it if you could kick the tires.
> To get you started, try the new demo:
> examples/pylab_examples/spine_placement_demo.py
I just did a quick read through of the spine code and example, and
have two minor comments.
You do an isinstance(arg, basestring) to check for string input.
Typically, we encourage cbook.is_string_like to have a central point
of maintenance and consistency for these checks.
Also, in the example, you appear to turn off a spine by setting the
color to 'none'. My thought it would be more natural to use the
"visible" artist property here (or at least support both)
@allow_rasterization
def draw(self,renderer):
"draw everything that belongs to the spine"
if not self.get_visible() or self.color.lower()=='none' or not
self.color:
# don't draw invisible spines
return
self.artist.draw(renderer)
Also, I think the class of strings representing "no color" in mpl is
larger -- it should also include self.color.lower()=='none' and the
empty string, which I've included in the example code.
JDH
|