MATLAB: How to make nice plots

latexmatlab plot in latex documentplotsplotting

Hello
Will plot in Matlab with the following code.
a = [1.23, 2.34, 5.55, 7, 13.21, 15.66, 18, 20]
x = 1:size(a);
figure('Name', 'Simple plot', 'NumberTitle', 'off');
plot(x, a, '-o');
xlabel('test');
ylabel('test');
I would like to include the plot in a paper which I'm writing, i.e. it should look really nice.
How can I make the plot looking better with Matlab?

Best Answer

I suppose everyone will have their own preferences for what looks "really nice". I use pdflatex to write most of my articles, and yes, I include figures via \includegrapics. There are some Matlab packages on the FEX to export figures to programatic latex graphics (e.g. TikZ), but most journals I've worked with prefer or require separate graphics files in the more common .png, .pdf, .eps, .jpeg, etc. format.
Some tips I use for getting nice, professional-looking graphics:
1) Save using export_fig; it will take care of a lot of the prettifying for you.
2) Make sure your figures, and everything in them, are properly-sized for the paper before exporting. Export using an appropriate resolution (at least 150 dpi, 300 dpi if file size doesn't prohibit it).
3) I usually change the fonts for all axis labels, titles, etc. (and sometimes the tick labels themselves, if they're not too small) to a serif font to match the rest of the text in the paper.
4) Don't rely on the default jet colormap. In addition to the fact rainbow colormaps are almost always a poor choice for visualizing data, I find that published figures that rely on it (and in my field, there are a lot of them) scream "I used Matlab and am lazy!" That's just a personal opinion, of course, but it just doesn't look very professional to me.