On Friday 28 September 2007 07:36:23 am John Hunter wrote:
> On 9/27/07, Darren Dale <[EMAIL PROTECTED]> wrote:
> > Hi Eric, John,
> >
> > Have either of you been following this thread?
>
> I am now :-)
>
> As Eric suggests, None is overloaded vis-a-vis color handling, because
> for mpl properties it generally means do the default as defined by rc.
>  For colors people often want to use None for "no color" which is why
> we added support for the string "None".  Does this work in your use
> case Tom?

The above exchange was off-list, we're back on now. I think that would be what 
Tom is looking for, but it doesnt work:

In [1]: plot([1,2])
Out[1]: [<matplotlib.lines.Line2D instance at 0x710cb0>]

In [2]: savefig('dsd.png', facecolor='None', edgecolor='None')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/darren/<ipython console> in <module>()

/usr/lib64/python2.5/site-packages/matplotlib/pyplot.py in savefig(*args, 
**kwargs)
    272 def savefig(*args, **kwargs):
    273     fig = gcf()
--> 274     return fig.savefig(*args, **kwargs)
    275 if Figure.savefig.__doc__ is not None:
    276     savefig.__doc__ = dedent(Figure.savefig.__doc__)

/usr/lib64/python2.5/site-packages/matplotlib/figure.py in savefig(self, 
*args, **kwargs)
    768                 kwargs[key] = rcParams['savefig.%s'%key]
    769
--> 770         self.canvas.print_figure(*args, **kwargs)
    771
    772     def colorbar(self, mappable, cax=None, **kw):

/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py in 
print_figure(self, *args, **kwargs)
    153         self.update(l, self.renderer.height-t, w, h)
    154
    155     def print_figure(self, *args, **kwargs):
--> 156         FigureCanvasAgg.print_figure(self, *args, **kwargs)
    157         self.draw()

/usr/lib64/python2.5/site-packages/matplotlib/backend_bases.py in 
print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, 
**kwargs)
   1194                 edgecolor=edgecolor,
   1195                 orientation=orientation,
-> 1196                 **kwargs)
   1197         finally:
   1198             self.figure.dpi.set(origDPI)

/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_agg.py in 
print_png(self, filename, *args, **kwargs)
    415
    416     def print_png(self, filename, *args, **kwargs):
--> 417         self.draw()
    418         self.get_renderer()._renderer.write_png(str(filename))
    419

/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py in 
draw(self)
    140         if DEBUG: print "FigureCanvasQtAgg.draw", self
    141         self.replot = True
--> 142         FigureCanvasAgg.draw(self)
    143         self.update()
    144

/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_agg.py in 
draw(self)
    377
    378         self.renderer = self.get_renderer()
--> 379         self.figure.draw(self.renderer)
    380
    381     def get_renderer(self):

/usr/lib64/python2.5/site-packages/matplotlib/figure.py in draw(self, 
renderer)
    586         self.transFigure.freeze()  # eval the lazy objects
    587
--> 588         if self.frameon: self.figurePatch.draw(renderer)
    589
    590         for p in self.patches: p.draw(renderer)

/usr/lib64/python2.5/site-packages/matplotlib/patches.py in draw(self, 
renderer)
    198         #renderer.open_group('patch')
    199         gc = renderer.new_gc()
--> 200         gc.set_foreground(self._edgecolor)
    201         gc.set_linewidth(self._linewidth)
    202         gc.set_alpha(self._alpha)

/usr/lib64/python2.5/site-packages/matplotlib/backend_bases.py in 
set_foreground(self, fg, isRGB)
    617             self._rgb = fg
    618         else:
--> 619             self._rgb = colors.colorConverter.to_rgb(fg)
    620
    621     def set_graylevel(self, frac):

/usr/lib64/python2.5/site-packages/matplotlib/colors.py in to_rgb(self, arg)
    277
    278         except (KeyError, ValueError, TypeError), exc:
--> 279             raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' % 
(str(arg), exc))
    280             # Error messages could be improved by handling TypeError
    281             # separately; but this should be rare and not too hard

ValueError: to_rgb: Invalid rgb arg "None"
invalid literal for float(): None

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to