# Postscript bounding box calculations

Hi, Currently matplotlib outputs postscript graphs which

> have no bounding box set. This means that by default they
> fill the whole page. If you want to include several plots
> in the same page in a document (because you generated
> them separately, or because the subplot output is a bit
> messy) then you have to manually crop each postscript
> graph. (Atleast that is my experience with LaTeX via lyx,
> Word is presumably similar.)

Hi Matthew, thanks for keeping the flame under my butt re EPS. This
is something that has come up a number of times and isn't hard to
implement. I just haven't taken the time to do it. Work has kept me
pretty busy the last two weeks.

There was a discussion on this mailing list some time ago where
several workarounds were discussed - sourceforge archives are
currently down or I'd post a link. I use the following: PS can be
included directly in LaTeX and sized

\usepackage[dvips]{graphics}

\newcommand{\dofig}[2]
{\center{\scalebox{#1}{\includegraphics*{#2}}}}

\begin{figure}[t]
\dofig{0.5}{somefile.ps}
\caption{\footnotesize Insert your figure caption here}
\label{fig:figref}
\end{figure}

0.5 is a scaling arg. Don't know how to do it in lyx though.

Others use ps2eps or ps2epsi.

But I can get the eps thing done with little effort -- I already know
the bounding box, it's just a matter of detecting the extension and
adding one line of code to the PS output.

Stay tuned!
John Hunter