edgecolor with usetex=True, usedistiller='pdf'

Hello,

When using usetex=True and

 savefig(file, facecolor='w', edgecolor='w')

The behavior of the generated EPS file is more like:
facecolor=None
edgecolor=‘w’

That is, the image’s facecolor is tranparent…taking on the background color of the latex document—while the edgecolor is definitely white.

This seems inconsistent to me, and I was wondering if there was a quick solution. I actually like that the facecolor is transparent (or nonexistent)…and I would like the same to hold for the edgecolor. As of now, I have an ugly white border around my image.

Also, it seems like there needs to be an extra keyword or option. Suppose someone wanted a white facecolor in the (usetex=True) EPS file. It doesn’t seem like this is currently possible. It would be nice if I could specify:

savefig(file, facecolor=None, edgecolor=None)

Thoughts?

\documentclass{article}
\usepackage{pstricks}
\usepackage{graphicx}
\begin{document}
\psframe*linecolor=blue(10in,10in)

\includegraphics{test}

from matplotlib import rc, rcParams
rc(‘text’, usetex=True)
rc(‘ps’, usedistiller=‘xpdf’)
from pylab import *
subplot(111,axisbg=‘red’)

plot(range(10))
savefig(‘test.eps’, facecolor=‘white’, edgecolor=‘white’)

It would also be nice if we could specify the axis background color to
be None as well (again, perhaps only useful when creating an EPS)…when using the plot command.

···

On 9/23/07, Tom Johnson <tjhnson@…287…> wrote:

Also, it seems like there needs to be an extra keyword or option. Suppose someone wanted a white facecolor in the (usetex=True) EPS file. It doesn’t seem like this is currently possible. It would be nice if I could specify:

savefig(file, facecolor=None, edgecolor=None)

Any comments on this? The behavior is, at best, inconsistent. At worst, the current behavior is incorrect, as it is not possible to have a white facecolor when using usetex/xpdf.

···

On 9/23/07, Tom Johnson <tjhnson@…287…> wrote:

On 9/23/07, Tom Johnson <tjhnson@…287…> wrote:

Also, it seems like there needs to be an extra keyword or option. Suppose someone wanted a white facecolor in the (usetex=True) EPS file. It doesn’t seem like this is currently possible. It would be nice if I could specify:

savefig(file, facecolor=None, edgecolor=None)

It would also be nice if we could specify the axis background color to
be None as well (again, perhaps only useful when creating an EPS)…when using the plot command.

Any comments on this? The behavior is, at best, inconsistent. At worst,
the current behavior is incorrect, as it is not possible to have a white
facecolor when using usetex/xpdf.

I used your script to create the eps file, and created the attached postscript
(you need an \end{document} in your latex code). Do you see anything wrong
with the resulting postscript? It looks fine to me.

dsd_test.ps (48.7 KB)

···

On Wednesday 26 September 2007 03:30:41 pm Tom Johnson wrote:

On 9/23/07, Tom Johnson <tjhnson@...287...> wrote:
> On 9/23/07, Tom Johnson <tjhnson@...287...> wrote:
> > Also, it seems like there needs to be an extra keyword or option.
> > Suppose someone wanted a white facecolor in the (usetex=True) EPS file.
> > It doesn't seem like this is currently possible. It would be nice if
> > I could specify:
> >
> > savefig(file, facecolor=None, edgecolor=None)
>
> It would also be nice if we could specify the axis background color to be
> None as well (again, perhaps only useful when creating an EPS)...when
> using the plot command.

That is probably a nontrivial change to mpl's existing color support.

Darren