4.0

4.0 | 3 ratings Rate this file 60 downloads (last 30 days) File Size: 31.62 KB File ID: #23698

plot2eps

by Mark Verveld

 

14 Apr 2009 (Updated 20 May 2009)

Code covered by BSD License  

Function to streamline the workflow of converting plots to eps files for inclusion in LaTeX.

Download Now | Watch this File

File Information
Description

Requires plotepstex.m and laprint.m (included)

PLOT2EPS() If all input arguments are omitted, the function will run in user input mode prompting the user for the appropriate inputs.

PLOT2EPS(FIGNAME) Converts all figures in the FIGNAME.FIG file. Other arguments are set to defaults. eps2pdf.bat is generated to convert the eps files to pdf if the user wishes.

PLOT2EPS(FIGHANDLE) Converts all figures in the FIGHANDLE vector. Other arguments are set to defaults. eps2pdf.bat is generated to convert the eps files to pdf if the user wishes.

PLOT2EPS(FIG,'Option',value,...) Specifies one or more of the following options:
'filename': Specify a cell row vector with filenames for the eps figures. The cell vector should have the same number of cells as there are figures to be converted. If not specified, plot2eps will attempt to derive filenames from the figure titles. When more than one subplot is present, the title of the last subplot is used.
'ratio': Specify the figure width/height ratio as a scalar if all are the same or as a vector to set different values for each figure.
'deletetitle': Boolean value to be able to delete the title from figures. This may be desirable in a LaTeX document where captions are used to describe the figures.
'dir': Specify a full path to the location where the eps files should be saved. Leave blank for saving in the current directory.

This archive includes versions of plotepstex and laprint in which certain issues are fixed (it seems that there are bugs related to compatibility with newer versions of matlab) and features added. I have modified these files to suit my needs and I publish them only as is. Use what changes you like.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
LaPrint, PlotEpsTeX

MATLAB release MATLAB 7.6 (R2008a)
Other requirements laprint, plotepstex, latex
Zip File Content  
Other Files laprint.m,
license.txt,
plot2eps.m,
plotepstex.m,
readme.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
22 May 2009 Jushi Hakinen

Nice work, thanks.
Now I can call one function in my script file to process all the plots and have them saved in the folder where my latex document is.
If something is changed in my results, I only have to run the script and compile my latex and voila I'm done.
Really saves a lot of work!

I did get an error when trying the @...@ text, but it was without having a $...$ mathcode in the string, so you can only use them together.

03 Nov 2009 M'Hamed-Ali

Very nice work thanks a lot. It saves a lot of work !!
However, I have some troubles using the @...@ text.
Could you put a simple example to illustrate the method.
On my side I have the following line:
$x_{\text{ter}}$ @xter@
At the end, the legendbox is still too large. I do not understand where is my mistake. For information, I use the MATLAB Version 7.8.0.347 (R2009a).
Thanks in advance.

18 Nov 2009 Peter Jakobsen

Fine work!

However, how am I supposed execute eps2pdf.bat? I suspect it might work on a Windows OS, but it doesn't work on Linux/Unix!!!

20 Nov 2009 Peter Jakobsen  
Please login to add a comment or rating.
Updates
14 Apr 2009

Corrected a bug when no path was specified.

Added fontsize and figure width options. Although figure width can easily be changed in latex, I have found that some figures need some more room to allow all the labels to print correctly.

16 Apr 2009

legend box width in plotepstex, added lines to set CurrentFigure and CurrentAxes in the powertext code, figuresize in plotepstex, figcopy off, full path support in plotepstex

20 May 2009

open source BSD license

Tag Activity for this File
Tag Applied By Date/Time
eps Mark Verveld 14 Apr 2009 11:41:41
export Mark Verveld 14 Apr 2009 11:41:41
graphics export Mark Verveld 14 Apr 2009 11:41:41
laprint Mark Verveld 14 Apr 2009 11:41:41
latex Mark Verveld 14 Apr 2009 11:41:41
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com