I previously
wrote about using the `epslatex` terminal in Gnuplot to generate
beautiful plots for inclusion in a LaTeX document. The secret is that
the `epslatex` terminal produces a combination of (1) EPS vector
graphics and (2) TeX instructions to overlay all the text (axis labels,
legends, etc.) in whatever font you are using in the rest of your document.
So typically you get that super slick looking Computer Modern Roman
(cmr) font.

Now, there are some things that are beyond the ken of Gnuplot. So it was a relief when I learned that GNU Octave can produce similarly formatted EPS + TeX graphics. What's nice about using Octave instead of Gnuplot is that, not only can you take advantage of Octave's more advanced (as I understand it) graphics facilities, but you can also bring to bear all the power of a full mathematical/simulation language for preprocessing your data or whatnot. I still usually use Gnuplot, but I break out Octave for making plots when necessary.

All you have to do is produce your plot in Octave as normal
(e.g. `plot(...)`), and use a command like the following to output in
EPS + Tex:

print('my_plot.tex', '-dtex');

As an example, here's some minimal code to produce a heatmap with contours and a legend:

x_values = [0.10 : 0.005 : 0.60]; y_values = [0.10 : 0.005 : 0.60]; contourf(x_values, y_values, data); % supply your own data... axis square; colorbar; xlim([0.1 0.6]); ylim([0.1 0.6]); print('-dtex', 'my_plot.tex');

Octave really saves the day here. To the best of my knowledge it is difficult or impossible to do this using just plain Gnuplot, especially if you are not plotting over a square area.