Code covered by the BSD License  

Highlights from
fig2tex

4.66667

4.7 | 3 ratings Rate this file 41 Downloads (last 30 days) File Size: 3.46 KB File ID: #7884
image thumbnail

fig2tex

by Ercan Solak

 

21 Jun 2005 (Updated 15 Sep 2008)

Converts MATLAB figure to a TeX file representation.

| Watch this File

File Information
Description

fig2tex is a MATLAB function that produces a LaTeX file to replicate MATLAB figures using PSTricks macros. ( the final LaTeX file requires the PSTricks packages pst-plot and pst-node, in particular).

With fig2tex, you have a LaTeX file that produces your figure in LaTeX + PSTricks. Hence, text style remains uniform throughout your document. Same thing for scaling. Moreover, small changes (like changing the label text) can directly be made on the LaTeX file.

Latest version 0.7, 2005/6/27
http://www2.isikun.edu.tr/personel/ercan.solak/fig2tex/index.htm

Acknowledgements
This submission has inspired the following:
figure to latex, fig2tex - With Marker, fig2texPS - Export Matlab Figure to LaTeX
MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements LaTeX, pst-plot, pst-node
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
22 Jun 2005 Ismail Demirkan

I tried this, works as promised. Figures look like excellent. You can avoid time consuming task of scaling small fonts in Matlab figures.
Thanks for sharing this.

22 Jun 2005 Radu Serban

Great idea! A few problems though:

1) To avoid "Conversion to cell from char is not possible." errors, the concatenation lines of the type
wrstr = [wrstr,linestr];
should be changed to
wrstr = [wrstr,{linestr}];

2) The functions chokes if the figure does not have a legend. It needs a test
if ~isempty(legh)

3) There are several elements that cannot appear in the figure (eg. rectangle, text) since they do not have an 'XData' property. The loop over the children handles should test the 'type' property and act accordingly.

16 Sep 2009 Lukas Sieberer

This provides a very convenient way to embed Matlab figures into LaTeX. The results look great!

Please login to add a comment or rating.
Updates
27 Jun 2005

Fixed some bugs and added some features

15 Sep 2008

My institution and the web address changed. Files are the same.

Tag Activity for this File
Tag Applied By Date/Time
graphics import Ercan Solak 22 Oct 2008 07:50:55
graphics export Ercan Solak 22 Oct 2008 07:50:55
latex Ercan Solak 22 Oct 2008 07:50:55
figure Ercan Solak 22 Oct 2008 07:50:55
converts Ercan Solak 22 Oct 2008 07:50:55
import Ercan Solak 22 Oct 2008 07:50:55
macros Ercan Solak 22 Oct 2008 07:50:55
graphics Ercan Solak 22 Oct 2008 07:50:55
pstricks Ercan Solak 22 Oct 2008 07:50:55
export Ercan Solak 22 Oct 2008 07:50:56
figure Marc 25 Sep 2009 08:55:36

Contact us at files@mathworks.com