I love the usetex option

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)
#===========================

This is cool.

About 18 months ago, I wanted, for various reasons, a linux that I could boot from an external USB drive. I never got that to work despite hours of tinkering with initrd in various distros. This might be better:

VMware ( http://www.vmware.com/ ) sells a product that makes virtual machines that run on WinXP and linux. For free, they make available VMware Player, an app that runs the VMs once constructed (kinda like Adobe Acrobat / Acrobat Reader). However, they maintain a collection of Really Useful preconfigured VMs ( http://www.vmware.com/vmtn/vm/ ) ready to go.

The demo is "Browser Appliance", a VM running Ubuntu Linux, preconfigured for web browsing with firefox. I installed that, and, wow, I got what appears to be a full-featured ubuntu VM. Running in full screen mode, it appears to be indistinguishable from a conventional linux installation... but it's not. It's in a VM on an XP host. XP is still running, and I can still use all the XP stuff.

But this ubuntu VM appears to run perfectly. It just works. On my T41 Thinkpad (Centrino) it finds and uses that pesky Centrino wireless device, with no effort on my part. I fired up the Synaptic Package Manager and starting adding packages. No sweat. I downloaded the matplotlib sources. (after grabbing gcc, etc) A couple of symbolic links, and a few tweaks of setup.py and matplotlibrc, and bingo! it compiles. And works!

The VM and its memory etc etc live in WinXP files on the WinXP file system. So I plug in an external USB drive (fat32 for historical reasons) and copy the VM files over there. Shoot... the dang thing just works.

As far as I can tell, I have a fully functional ubuntu on my external USB drive. I'm in the process of stressing the system in various ways, and so far, everything works. Haven't tried printing, yet. There's no obvious way to mount the WinXP file system, although I ran across a reference that says Samba works for communication to the host. Haven't tried it.

I had *no* (as in *zero*) problems installing it and getting it to work. It's *never* this easy. One thing I'm not sure of: speed. But it is not obviously slower than a native installation. None of the software installations or the compiling went noticibly slower than expected.

The irony is that I don't think I need it anymore.

-gary

Thanks to Darren and anyone else involved in making the usetex option
work. It generates the most beautiful plots I have ever seen.

That's great to hear. There have been several contributors along the way,
notably JDH who had the idea in the first place.

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.)

I need to get the wiki page back up, this ps2eps problem was discussed there.
I guess I can work on it during lunch today.

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.

Maybe I could test for the necessary deps (ps2eps, xpdf, ghostscript, etc) in
backend_ps, and if they are all available, then the eps->pdf->ps->eps
renormalization step is performed, and if not, an error message is passed to
mpl verbose and the backup distillation step is performed. John, is this
acceptable?

Darren

···

On Wednesday 04 January 2006 10:59, Ryan Krauss wrote:

For what its worth, I have ubuntu running on and external USB drive
with only a little bit of pain with the init stuff.

Ryan

···

On 1/4/06, Gary <pajer@...97...> wrote:

This is cool.

About 18 months ago, I wanted, for various reasons, a linux that I could
boot from an external USB drive. I never got that to work despite hours
of tinkering with initrd in various distros. This might be better:

VMware ( http://www.vmware.com/ ) sells a product that makes virtual
machines that run on WinXP and linux. For free, they make available
VMware Player, an app that runs the VMs once constructed (kinda like
Adobe Acrobat / Acrobat Reader). However, they maintain a collection of
Really Useful preconfigured VMs ( http://www.vmware.com/vmtn/vm/ )
ready to go.

The demo is "Browser Appliance", a VM running Ubuntu Linux,
preconfigured for web browsing with firefox. I installed that, and,
wow, I got what appears to be a full-featured ubuntu VM. Running in
full screen mode, it appears to be indistinguishable from a conventional
linux installation... but it's not. It's in a VM on an XP host. XP is
still running, and I can still use all the XP stuff.

But this ubuntu VM appears to run perfectly. It just works. On my T41
Thinkpad (Centrino) it finds and uses that pesky Centrino wireless
device, with no effort on my part. I fired up the Synaptic Package
Manager and starting adding packages. No sweat. I downloaded the
matplotlib sources. (after grabbing gcc, etc) A couple of symbolic
links, and a few tweaks of setup.py and matplotlibrc, and bingo! it
compiles. And works!

The VM and its memory etc etc live in WinXP files on the WinXP file
system. So I plug in an external USB drive (fat32 for historical
reasons) and copy the VM files over there. Shoot... the dang thing just
works.

As far as I can tell, I have a fully functional ubuntu on my external
USB drive. I'm in the process of stressing the system in various ways,
and so far, everything works. Haven't tried printing, yet. There's no
obvious way to mount the WinXP file system, although I ran across a
reference that says Samba works for communication to the host. Haven't
tried it.

I had *no* (as in *zero*) problems installing it and getting it to
work. It's *never* this easy. One thing I'm not sure of: speed. But
it is not obviously slower than a native installation. None of the
software installations or the compiling went noticibly slower than expected.

The irony is that I don't think I need it anymore.

-gary

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

The usetex wiki entry is back up. (and backed up)

···

On Wednesday 04 January 2006 12:14, Darren Dale wrote:

> 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.)

I need to get the wiki page back up, this ps2eps problem was discussed
there. I guess I can work on it during lunch today.