Thanks to Darren and anyone else involved in making the usetex option
work. It generates the most beautiful plots I have ever seen. And
following the advice Darren posted a while back, the text in my axis
labels is searchable when the plots are included in a pdf.
I had to make one very small tweak to what he posted (included at the
end of this message).
There is one line that sets up a command like this:
command = '/usr/local/bin/ps2eps -l "%s"'% psfile
This file did not exist on my machine, but installing the ps2eps
package from the ubuntu package manager and changing the command to
command = 'ps2eps -l "%s"'% psfile
worked perfectly (I realize this is a very simple thing, but I took a
little bit of work to track it down - the error message generate
wasn't all that helpful. So, I include it here in hopes of saving
someone else a little trouble.)
Is there any way that this option that preserves the text could be an
rc option? I can see myself making this change every time a new
version is released.
Thanks,
Ryan
···
#=============================
You can remove the following block in backend_ps.py, starting around line
1144:
command = 'latex -interaction=nonstopmode "%s"' % texfile
verbose.report(command, 'debug-annoying')
stdin, stdout, stderr = os.popen3(command)
verbose.report(stdout.read(), 'debug-annoying')
verbose.report(stderr.read(), 'helpful')
command = 'dvips -R -T %fin,%fin -o "%s" "%s"' % (pw, ph, psfile,
dvifile)
verbose.report(command, 'debug-annoying')
stdin, stdout, stderr = os.popen3(command)
verbose.report(stdout.read(), 'debug-annoying')
verbose.report(stderr.read(), 'helpful')
os.remove(epsfile)
if ext.startswith('.ep'):
dpi = rcParams['ps.distiller.res']
if sys.platform == 'win32':
command = 'gswin32c -dBATCH -dNOPAUSE -dSAFER -r%d \
-sDEVICE=epswrite -dLanguageLevel=2 -dEPSFitPage \
-sOutputFile="%s" "%s"'% (dpi, epsfile, psfile)
else:
command = 'gs -dBATCH -dNOPAUSE -dSAFER -r%d \
-sDEVICE=epswrite -dLanguageLevel=2 -dEPSFitPage \
-sOutputFile="%s" "%s"'% (dpi, epsfile, psfile)
verbose.report(command, 'debug-annoying')
stdin, stdout, stderr = os.popen3(command)
verbose.report(stdout.read(), 'debug-annoying')
verbose.report(stderr.read(), 'helpful')
shutil.move(epsfile, outfile)
else: shutil.move(psfile, outfile)
and replace it with this:
command = 'latex -interaction=nonstopmode "%s"' % texfile
verbose.report(command, 'debug-annoying')
stdin, stdout, stderr = os.popen3(command)
verbose.report(stdout.read(), 'debug-annoying')
verbose.report(stderr.read(), 'helpful')
command = 'dvips -R -T %fin,%fin -o "%s" "%s"' % (pw, ph, psfile,
dvifile)
verbose.report(command, 'debug-annoying')
stdin, stdout, stderr = os.popen3(command)
verbose.report(stdout.read(), 'debug-annoying')
verbose.report(stderr.read(), 'helpful')
os.remove(epsfile)
pdffile = tmpname + '.pdf'
if ext.startswith('.ep'):
command = 'ps2pdf "%s"'% psfile
os.system(command)
command = 'pdftops -level2 "%s" "%s"'% (pdffile, psfile)
os.system(command)
os.remove(pdffile)
command = '/usr/local/bin/ps2eps -l "%s"'% psfile
stdin, stderr = os.popen4(command)
verbose.report(stderr.read(), 'helpful')
command = 'epstopdf "%s"'% epsfile
os.system(command)
shutil.move(epsfile, outfile)
shutil.move(pdffile, basename+'.pdf')
else:
command = 'ps2pdf "%s" "%s"'% (psfile, pdffile)
stdin, stderr = os.popen4(command)
verbose.report(stderr.read(), 'helpful')
os.remove(psfile)
command = 'pdftops -paperw %d -paperh %d -level2 "%s" "%s"'% \
(int(pw*72), int(ph*72), pdffile, psfile)
os.system(command)
shutil.move(psfile, outfile)
#===========================