3.5

3.5 | 6 ratings Rate this file 42 downloads (last 30 days) File Size: 6.95 KB File ID: #18207

PlotEpsTeX

by jean-christophe OLIVIER

 

03 Jan 2008 (Updated 17 Mar 2008)

No BSD License  

eps file exportation with LaTeX text and symbols

Download Now | Watch this File

File Information
Description

PLOTEPSTEX prints an EPS figure for inclusion in LaTeX documents, with LaTeX fonts. It creates a complet EPS-file with annotation of the figure (titles, labels and texts) and graphics (lines,arrows,markers,...). This function uses the LAPRINT function and makes simply a concatenation of the text part and the graphical part in a single EPS file. It requires:
laprint.m, latex, dvips, eps2eps and GhostScript.

With the EPS2EPS command, PS file is converted in an eps-file, with bitmap-fonts. Result is a small size file. It is possible to replace the eps2eps command by the ps2epsi

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
LaPrint
This submission has inspired the following:
PlotPdfTex, plot2eps

MATLAB release MATLAB 6.5 (R13)
Other requirements latex, dvips, ps2epsi and GhostScript
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (9)
22 Jan 2008 Matthias Hesse

PLOTEPSTEX is a very useful function!

But I had some problems to get it working on MacOs 10.4.
The main issue was that Matlab doesn't search in searchfolders, only in /usr/bin/. In my case latex, dvips and the other commands weren't located in /usr/bin/. A symbolic link solves that.
sudo ln -s ...dirToLatex/latex /usr/bin/latex to find dirToLatex: which latex
An other problem was that dvips writes to the standard out; in my case the printer. To ensure that the output is written to a file change line 159 to:
Str=sprintf('dvips %s2.dvi -o %s2.ps',TempName);
Otherwise you may have a big pile of graphs like me ;)

16 Feb 2008 Derek O'Connor

Creates a very large eps file.

Example:
x = linspace(-2*pi,2*pi); y = sin(x); plot(x);
In Matlab save as eps: size = 10K but B. Box is loose. Need to run it through GView PS to EPS to get tight BB. Same size with tight BB.

PLOTEPSTEX generates an eps file with tight BB but file size is 220K.

I looked at this file and its has a lot of raw numbers. I don't understand PS so maybe somebody can explain the huge files generated by this function.

QUESTION : Why do we need functions such as this? Why can't Matlab do it properly?

11 Mar 2008 Mukhtar Ullah

You can avoid bitmap fonts by using the option -dNOCACHE with EPS2EPS.

21 May 2008 Oskar Vivero

Very useful function. I'm running MacOs 10.5(Leopard) and I had to run the same fix that Matthias Hesse recommended on his post, except that the symbolic links were not only for latex, but also dvips, gs and eps2eps. Once I got it working the function has saved me quite some time

11 Apr 2009 Felicity

I'm excited by the possibilities of this program. However, (on Windows), I'm having real problems to get it to work reliably. It's worked twice (out of many attempted times), but most other times I get a latex error. I am not sure what difference there was in the various times I used it - to me they seemed the same. It stops at the latex step, with latex being unable to find the aux file. Could this problem be related to having to create a symbolic link? If anyone has experience troubleshooting this function on Windows, I'd really appreciate any help.

16 Apr 2009 Mark Verveld

Thanks for this function, it is very helpful.
I have added a feature to adjust the legend width when using math code. The math code takes a lot of space which makes the legend too wide. With this feature you can add placeholder text delimited by @...@ in a legend line. This isn't printed in the eps, but it is used to size the legend. This gives correct legend box widths. The modified file is included with the latest update of plot2eps, which uses plotepstex and laprint and further streamlines the work flow.

16 Sep 2009 almog shalom

I have problems with this functions:
The labels and the title always get cut.
Why is it?

05 Jan 2010 MSS SSM  
22 Mar 2010 Dylan

legend2latex fixes the legend problem without the need for @...@. See my comment on the legend2latex File Exchange page for info on how to incorporate it into plotepstex.

Please login to add a comment or rating.
Updates
08 Jan 2008

There is a problem with the [Width Ratio FontSize] parameters.

09 Jan 2008

To get it run on a Linux-System

23 Jan 2008

Resolve the problem of the redirection of the dvips output (thanks to Matthias Hesse and Patrick H

30 Jan 2008

Problem with the dvips command.

25 Feb 2008

Very large EPS file produced by the PS2EPSI command. Changed with the EPS2EPS command.

17 Mar 2008

To avoid bitmap fonts with the eps2eps command (Mukhtar Ullah)

Tag Activity for this File
Tag Applied By Date/Time
graphics import jean-christophe OLIVIER 22 Oct 2008 09:41:45
graphics export jean-christophe OLIVIER 22 Oct 2008 09:41:45
latex jean-christophe OLIVIER 22 Oct 2008 09:41:45
eps jean-christophe OLIVIER 22 Oct 2008 09:41:45
laprint jean-christophe OLIVIER 22 Oct 2008 09:41:45
export jean-christophe OLIVIER 22 Oct 2008 09:41:45
latex Bernhard 31 Dec 2008 10:45:24
laprint Eva 29 Jun 2009 12:09:08

Contact us at files@mathworks.com