Here is the ljfig.gnuplot file:
set output "ljfig.eps" set terminal epslatex '"default" 12' set xlabel "number of subscribers" set ylabel "cost to each subscriber" set xrange [1:25] set grid plot 1/(log(x)/log(5) + 1) t "\\key "
You compile it with something like "gnuplot ljfig.gnuplot && epstopdf ljfig.eps". And here is the lj.tex file:
\documentclass[12pt]{article}
\usepackage{graphicx,times}
\begin{document}
\begin{figure}
\newcommand{\key}{$\left(\frac{\log(x)}{\log(5)} + 1 \right)^{-1}$}
\input{ljfig}
\caption{LiveJournal syndication costs}
\end{figure}
\end{document}
And here is the resulting figure (after running through pdflatex, and then converting back to PNG):
Notice that this is much closer to publication quality than anything Matlab ever produces. The text is all legible, not too small. The figure uses the same font as the caption below and the rest of the PDF file. The y-axis label is properly rotated and the function key is correctly typeset as a formula. The only flaw is the imperfect grid line behind the function key.
If you use Debian the gnuplot manual is separately packaged as gnuplot-doc.
March 18 2004, 13:38:22 UTC 8 years ago
March 18 2004, 16:00:10 UTC 8 years ago
sub syn_cost
{
my $watchers = shift;
return 1 if $watchers < 1;
return 1/(log($watchers)/log(5)+1);
}
Not that bad. *shrug*
March 19 2004, 05:34:53 UTC 8 years ago
I'm mildly curious, how did you stumble upon my journal entry?
March 19 2004, 16:47:15 UTC 8 years ago
March 19 2004, 19:08:10 UTC 8 years ago
For the record
My primary motivation in writing this up was to show how to make Gnuplot and PDFLaTeX interact, not explain anything about LJ. Producing good figures is hard, and I wanted to keep notes on one way of doing it.March 18 2004, 16:53:01 UTC 8 years ago