Warning: Trying to access array offset on value of type bool in /data/www/freeminded.org/www/wp-content/plugins/wp-latex/wp-latex.php on line 39 Gnuplot: increasing readability of plots @ Freeminded.org Warning: Trying to access array offset on value of type bool in /data/www/freeminded.org/www/wp-content/plugins/wp-latex/wp-latex.php on line 46

Gnuplot: increasing readability of plots

This entry was posted by on Friday, 23 September, 2011 at

Gnuplot is a great way to plot your data. It is very powerful, easily attached to all your analysis tools and scripts and provides publication-ready vector output (or to any other thinkable printer, image format, character device etc.). It’s just not always that easy to find the correct commands to do what you want.
Remember: in case of trouble: type ‘test’ at the gnuplot terminal. It gives some output of line colors, types, and point types. However, it does not always seem correct (at least not on my system).

Increasing line width
set style line 1 lw 2

Increasing font size

A quick way to get color EPS figures, with wider lines and Times fonts of pretty good size:
set terminal postscript eps enhanced color lw 2 \"Times\" 20

Because sometimes it pays off to produce your figures in gray tones:
set terminal postscript eps enhanced mono dashed lw 2 \"Times\" 20

Increasing symbol / point size
set pointsize 2

AXES

Limiting axis
Gnuplot does good auto-ranging of axis. However, sometimes you may want to override it, like so:
set yrange [0:1]

Custom axis tics
Normally, tics are placed at decent locations. If you want to explicitly tell gnuplot where to place the tics on an axis:
set xtics (10, 20, 40, 80, 120, 160, 200)

Moving labels
Often, default placement of labels is ok. Sometimes, you may want to alter this:
set zlabel \"Nuppis\" offset 2,0

Rotating labels
You may want to rotate a label, so it aligns with the axis:
set zlabel \"Missed lunches\" rotate by 90 offset 2,0

3D PLOTS

Rotating 3D plots
Splot is very powerful. But sometimes you want to look at it from a different angle:
set view 50,240

Move z-axis intersect with X,Y plane
By default, gnuplot puts your splots on ‘stilts’, where they float well above the X,Y plane. This may look awkward for some of your plots. You can manually set the level at which to intersect:
set ticslevel 0.0


Leave a Reply