On Wed, Apr 28, 2010 at 12:22 PM, Eric Firing <efir...@hawaii.edu> wrote:
>
> It's a bug, made more confusing by the trickery that is done when printing a
> figure.  DPI, facecolor, and edgecolor that are set for a figure object are
> used only for screen display, and are overridden when the figure is saved.
>  The overriding values can be supplied to the savefig call or via rcParams.
>
> I think I have fixed the bug in svn, so that "transparent" will work as
> advertised.  In addition, I made a change so that even with
> transparent=True, if you supply facecolor and/or edgecolor to the savefig
> call, those values should be used for the figure patch when the figure is
> saved.  This might be useful if you want to keep the line around the figure,
> for example.
>

This still does not work for me.  I dug around a bit and found an
issue.  Figure.savefig() sets the 'edgecolor' and 'facecolor' of the
axis patches but delegates the patches of the figure to the actual
print command.  It does this by setting the edgecolor and facecolor
values in the kwargs dict.  However, self.canvas.print_figure()
expects edgecolor and facecolor as args, not kwargs.  So
print_figure() uses the default value: 'w' instead of 'none'.  This is
a bit inconsistent, it seems, especially b/c the PS backend  (which is
called after print_figure()) expects facecolor and edgecolor as
kwargs.

I went ahead and changed this, hoping it'd fix the issue, but it does
not.  At least now, I can see that the edgecolor and facecolor are
both set to 'none' all the way until self.figure.draw(renderer) is
called.  So somehow, the draw() command is unaffected by this still.

What next?

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to