[SciPy-user] Broken pipe for xplt.eps (Other issue)

Fernando Perez fperez at colorado.edu
Tue Apr 8 19:03:35 EDT 2003


Travis E. Oliphant wrote:

> I've been doing some testing and it looks like there is a real 
> bounding-box issue here.
> 
> Unfortunately, I am not an expert on these issues and am not sure how to 
> fix the problem.

This is a long shot, as I'm not an expert _at all_ on this stuff myself.  But 
in IPython's gnuplot support, at one point I coded in the following utility 
function for my own use:


def eps_fix_bbox(fname):
     """Fix the bounding box of an eps file by running ps2eps on it.

     If its name ends in .eps, the original file is removed.

     This is particularly useful for plots made by Gnuplot with square aspect
     ratio: there is a bug in Gnuplot which makes it generate a bounding box
     which is far wider than the actual plot.

     This function assumes that ps2eps is installed in your system."""

     # note: ps2ps and eps2eps do NOT work, ONLY ps2eps works correctly. The
     # others make output with bitmapped fonts, which looks horrible.
     print 'Fixing eps file: <%s>' % fname
     xsys('ps2eps -f -q -l %s' % fname)
     if fname.endswith('.eps'):
         os.rename(fname+'.eps',fname)


So maybe using ps2eps may help.  See the note in the code: I remember testing 
all the various *ps2*ps* utilities, and settling on ps2eps as the one that 
seemed to work best.  Please don't ask me why, they all seem to do slightly, 
subtly different things.  I remember being quite annoyed at all that, but 
eventually ps2eps seemed to fix at least my problems.

I hope this is of some help.

Best,

f.




More information about the SciPy-User mailing list