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
Ercan Solak (2019). fig2tex (https://www.mathworks.com/matlabcentral/fileexchange/7884-fig2tex), MATLAB Central File Exchange. Retrieved .
1.0.0.0 | My institution and the web address changed. Files are the same. |
|
Fixed some bugs and added some features |
Inspired: figure to latex, fig2tex - With Marker, fig2texPS - Export Matlab Figure to LaTeX
Create scripts with code, output, and formatted text in a single executable document.
Lukas Sieberer (view profile)
This provides a very convenient way to embed Matlab figures into LaTeX. The results look great!
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.
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.