Attractive scientific plots with gnuplot

I use gnuplot for nearly all my graph-drawing for academic publications. On the whole, it's clean and relatively flexible, and that combined with inertia has been enough to keep me from trying interesting alternatives like matplotlib, Plot, ploticus, and R. However, gnuplot's default output is not especially pretty. I often see graphs in papers that look like this...

...or worse, if it's been bitmapped rather than using EPS or PDF. With some tweaking, however, one can produce much more attractive output. I would much rather look at plots like this:

In fact it looks better. Blogger doesn't seem to support any vector image format, but here are the pdf version and the svg version. To produce the PDF version, you need gnuplot 4.4's pdfcairo terminal. Below, you can see the gnuplot files for the above two plots.



Now here's something for which I would pay (some) real money: a gnuplot terminal which outputs directly to Keynote. Then, for example, during a presentation, one could have lines in the plot appear one at a time, explaining each without the distraction of showing irrelevant objects. This should actually be quite doable since Keynote's format is just a zipped XML.

Update 2011.04.09: Mac users of macports may note that the default install of gnuplot for some reason excludes pdfcairo. Abhinav Bhatele writes with instructions for enabling pdfcairo in macports:

$ sudo port edit gnuplot

Add these lines somewhere in the file (I added them before the lua variant):

variant pangocairo description "Enable pdfcairo" {
     depends_lib-append      port:pango
     configure.args-delete   --without-cairo
     configure.args-append   --with-cairo
}

$ sudo port info gnuplot

Just to check that pangocairo variant exists. And then:

$ sudo port uninstall gnuplot
$ sudo port install gnuplot +pangocairo

You'll need to keep in mind that if you do port selfupdate,
the edited version of the portfile might get overwritten.

Update to the update 2011.12.04: Looks like macports now includes the pangocairo variant, but still does not install it by default; so it should work if you run just the last two lines.

Update 2011.04.09: Added SVG version and made it slightly more beautiful.

Update 2013.06.21: Added fontscale 1.0 in PDF version. Also, it seems the SVG output now looks somewhat different in a more recent gnuplot ... will have to fix that sometime.