Inconsistency between PS and other backends

Hi,

I am using the matplotlib library that comes with Ubuntu 7.04. This is
version 0.87.7 with ESP ghostscript 8.15.4.

I am trying to produce a very simple EPS figure, but the EPS file is
different than what I see on the screen in the GTKAgg window, or when
I save the figure as a PNG file. It looks like the coordinate system
in the PS case is different, and so the objects in the figure are
placed in different locations.

The code that I am using is:

import matplotlib
from pylab import *
from matplotlib.patches import Ellipse
from matplotlib.text import Text

xy1=(0.38,0.52)
xy2=(0.5,0.5)

e1 = Ellipse(xy=xy1, width=1e-1, height=3e-1, \
     angle=30.0, linewidth=2, fill=False)

e2 = Ellipse(xy=xy2, width=1e-1, height=3e-1, \
     angle=-30, linewidth=2, fill=False)

ax=gca()
ax.add_artist(e1)
ax.add_artist(e2)

axis('off')

savefig('ellipse.eps')
savefig('ellipse.png')

If you run it and view the two files ellipse.eps and ellipse.png -
you'll notice they look different. In the PNG file the ellipses
intersect, but in the EPS file they don't.

What's wrong here?

Thanks,
Itai.

There appears to be a problem with Agg -- not sure about PS yet. We
recently added support for "true ellipses" using arcs rather than
polygons, and it appears we have messed something up. Charlie, take a
look at this case -- depending on the y-zoom the x extent of the
ellipse is different:

from pylab import figure, show
from matplotlib.patches import Ellipse

xy = 0.38,0.52

props = dict(xy=xy, width=1e-1, height=3e-1,
             facecolor='red',
             angle=30.0, linewidth=2, fill=True, alpha=0.5)
e1 = Ellipse(**props)
e2 = Ellipse(**props)

fig = figure()
ax1 = fig.add_subplot(211)
ax1.add_artist(e1)
ax1.set_xlim(-.1, .7)
ax1.set_ylim(0.35, .7)

ax2 = fig.add_subplot(212, sharex=ax1)
ax2.add_artist(e2)
ax2.set_ylim(0.4, .6)

show()

Any ideas?

JDH

···

On 6/18/07, Itai Arad <itaitay@...287...> wrote:

I am trying to produce a very simple EPS figure, but the EPS file is
different than what I see on the screen in the GTKAgg window, or when
I save the figure as a PNG file. It looks like the coordinate system
in the PS case is different, and so the objects in the figure are
placed in different locations.