This is a matlab script which intends to provide cropped and clean pictures. This is done by exporting to eps and following conversion to the other formats by using Ghostscript.
This script suffers from the eps font bug as well. There is thus not much difference to pure matlab:painters eps export.
The tool collection export_fig with examples found here provides solutions for most matlab problems such as visual accuracy, resolution, the shrinking dots & dashes bug, and many others. It uses Ghostscript and xpdf internally.
the linestyle quality is perfect. However since this script relies on eps export it includes the font problem
Here the font is correct, as already with matlab standard opengl export. But it demonstrates cleary the shrinking dots & dashes bug!
The tool plot2svg tries to solve all the problem described so far by exporting to svg. From here png, eps and pdf conversion is possible without any loss or change of quality
This picture was created by exporting to png with 600dpi resolution. It shows that fonts and linestyles are perfect. However the whole plot is cropped at the upper boundary, which clearyl is a bug of this approach or this script.
This is my own approach to this problem. It uses matlabfrag to get around the eps font problem. The linestyles are corrected using the ‘fix_lines.m’ script from export_fig. However this requires a complete LaTeX collection and converts the resulting pdf afterwards in the target format. This script was inspired by mlf2pdf and I had to patch matlabfrag to support also non math fonts.
Here linestyles and fonts are correct. Only the title is in bold which was introduced by matlabfrag.
The output of latexfigure looks great! I’ve wanted to find a good solution to separating text and graphics for some time, and this looks like it. I would love to see it on the Matlab Central File Exchange, or else be able to download the latest version from somewhere.
Currently I have not the time for this code (I am partly still working on it). But I promise to publish it within the next month…
In the meantime you can still use the matlabfrag package which is what I use internally.
The code for
latexfigureis now online available from http://code.google.com/p/latexfigure/.If you experience problems or have code or ideas for further improments post here or me directly.
Thanks for the great code!
I do have a problem when trying to plot over very small or large ranges (i.e. 1E-07, 1E07..). It seems that Ghostscript can’t handle that form of notation? I’m running Matlab on OSX (Snow Leopard).
Thanks a lot