Friday, July 11, 2008

gnuplot + PlotDrop - plotting the data for high quality IEEE publications

gnuplot is a command-driven interactive function and data plotting program. PlotDrop is its simple and user friendly frontend. PlotDrop can be used with latex/pdflatex for generatating high quality figures for IEEE publications, theses, etc. Beside the limited number of gnuplot commands that are available through the GUI, PlotDrop enables specifying arbitrary commands through the Extra tab (command line style). The following gnuplot commands are more or less what I use when generating figures for IEEE publications:

  • set terminal postscript eps enhanced solid monochrome "NimbusSanL-Regu" fontfile "/usr/share/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb"
1. enhanced flag enables enhanced text features (subscript/superscript)
2. solid flag makes all the lines non-dashed
3. monochrome flag makes all the lines black
4. "NimbusSanL-Regu" fontfile "/usr/share/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb" - construct sets the default font to NimbusSanL-Regu instead of Helvetica and enables font embedding in the pdf (useful for IEEE papers produced with latex/pdflatex).
  • set size 0.75,0.75 - Scales the graph and not the fonts, so the fonts are bigger at the output.
  • set key bottom right - Puts the "legend" at the bottom right corner. Valid flags are: top, center, bottom, right, left, above, below, outside and inside. Also, you can specify absolute coordinates of the top-right box corner within the plot coordinate system, as follows: set key at 4.2,0.2.
  • set key spacing 2 - Increases the vertical spacing between labels in the "legend".
  • set key box - Draws the box around the "legend".
  • set key width 1 - Increases the key box width by the width of 1 character.
  • set pointsize 1.5 - Sets the point (marker) size at 1.5 (default is 1).
  • set bar 1.5 - Sets the bar size at 1.5.
  • set ytics nomirror - Remove tics on the right (vertical) border line.
  • set xtics nomirror - Remove tics on the top (horizontal) border line.
  • set tics out - X and Y tics point outside instead of inside of the axes.
  • set title font "NimbusSanL-Regu,20"
  • set ylabel font "NimbusSanL-Regu,20"
  • set xlabel font "NimbusSanL-Regu,20"
  • set label font "NimbusSanL-Regu,20"
The previous four commands set title, y-axis and x-axis label and other labels fonts to NimbusSanL-Regu, size 20.

With this setup you can generate very good figures in ps/eps/fig/latex/etc. formats (Plot->Plot to file). To import figures in pdflatex you have to convert ps to pdf. For this conversion use epstopdf and not ps2pdf!

1 comment:

Unknown said...

Voleo bih da sam ovo znao tokom pisanja moje teze