Code covered by the BSD License  

Highlights from
exportEpsPdf

Be the first to rate this file! 6 Downloads (last 30 days) File Size: 3.27 KB File ID: #28275

exportEpsPdf

by Daniel

 

23 Jul 2010 (Updated 23 Jul 2010)

exporte a figure to eps and pdf using laprint, latex and ghostscript (Requires laprint!!!)

| Watch this File

File Information
Description

This functions uses laprint to generate the eps and tex for a matlab figure. To make this great function available to pdflatex, this funciton was created. It adds a document header to the tex file, compiles it, and converts eps to pdf (including the boundingbox optimisation)
Export a figure with:
 set(0,'defaulttextinterpreter','none') % wichtig für laprint
 h1=figure;
 x=1:0.01:6;
 plot(x,sin(x.^2+x))
 xlabel('$x$ in m')
 ylabel('$y=\sin( x^2+x)$ ')
 exportEpsPdf('mytestfig','Ghostscript','C:\Programme\gs\gs8.71\bin\gswin32c.exe')

And include the images in latex without extension (latex will take the eps and pdflatex the pdf):

 \begin{figure}
 \includegraphics{bilder/mytestfig}
 \caption{My MATLAB figure}
 \end{figure}

Acknowledgements

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

MATLAB release MATLAB 7.10 (2010a)
Other requirements latex, ghostscript, dvips, laprint
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
23 Jul 2010

removed small bugs e.g. fn was set directly in the function

Tag Activity for this File
Tag Applied By Date/Time
eps Daniel 23 Jul 2010 09:22:49
pdf Daniel 23 Jul 2010 09:22:49
latex Daniel 23 Jul 2010 09:22:49
export Daniel 23 Jul 2010 09:22:49
savefig Daniel 23 Jul 2010 09:22:49
figure Daniel 23 Jul 2010 09:22:49

Contact us at files@mathworks.com