Code snippets‎ > ‎Utilities‎ > ‎

Gnuplot

Header


Set the output of gnuplot to a postscript file:
set terminal postscript color
set out 'plot.eps'

Define a function:

max(x,y)=(x<y)?y:x;

Generic gnuplot options command
Labels  
Create a title set title “Force-Deflection Data”
Put a label on the x-axis set xlabel “Deflection (meters)”
Put a label on the y-axis set ylabel “Force (kN)”
Put a label on the plot set label “yield point” at 0.003, 260
Remove all labels unset label
Ranges
Change the x-axis range set xrange [0.001:0.005]
Change the y-axis range set yrange [20:500]
Have Gnuplot determine ranges set autoscale
Plot using log-axes set logscale
Plot using log-axes on y-axis unset logscale; set logscale y
Ticks
Change the tic-marks set xtics (0.002,0.004,0.006,0.008)
Return to the default tics unset xtics; set xtics auto
Comments