|
From: Darren D. <dd...@co...> - 2007-02-05 21:41:34
|
On Monday 05 February 2007 04:06:45 pm Berthold H=C3=B6llmann wrote:
> With the script
>
> ----
> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanv=
as
> from matplotlib.figure import Figure
> from matplotlib.patches import Rectangle
> fig =3D Figure()
> canvas =3D FigureCanvas(fig)
> ax =3D fig.add_subplot(111)
> ax.plot([.5,.7],[1.5, 2.5])
> ax.add_artist(Rectangle((.5, 1.5), .2, 1, fill=3DFalse))
> ax.set_aspect("equal")
> canvas.print_figure('test.eps')
> ----
>
> I get a file 'test.eps'. Using matplotlib 0.87.7 the PS bounding box
> of the generated plot is far to wide. Is this a problem with my script
> or a Problem of FigureCanvasAgg (and FigureCanvasPS)? What can I do to
> get a tight bounding box?
The bounding box is determined by the size of your figure window. Try=20
something like:
fig=3DFigure(figsize=3D(2,4))
> Further, when I leave out the "ax.plot" line, the generated figure is
> missing the "Rectangle" and is showing only a pair of axes counting
> from 0 to 1. Is that a bug of matplotlib or something I have to fix in
> my script?
It looks like a bug to me, but right now I don't have time to look into it=
=20
further. Maybe someone else could comment, or you could file a bug report a=
t=20
sourceforge.
Darren
|