No BSD License  

3.5

3.5 | 6 ratings Rate this file 25 Downloads (last 30 days) File Size: 6.95 KB File ID: #18207
image thumbnail

PlotEpsTeX

by

 

03 Jan 2008 (Updated )

eps file exportation with LaTeX text and symbols

| 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

La Print inspired this file.

This file inspired Plot2eps and Plot Pdf Tex.

MATLAB release MATLAB 6.5 (R13)
Other requirements latex, dvips, ps2epsi and GhostScript
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
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.

05 Jan 2010 MSS SSM  
16 Sep 2009 almog shalom

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

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.

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.

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 Mar 2008 Mukhtar Ullah

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

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?

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

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.

Contact us