6. Two axes and a model
The residual (log) and the drag coefficient (linear) on one plot: each needs its own scale. The second y axis, on the right, gives it — and a model function lies over the data.
gnuplot
set logscale y
set ylabel 'continuity residual'
set y2label 'cd'
set ytics nomirror
set y2ticsgnuplot
plot 'run.dat' using 1:2 title 'continuity', \
'' using 1:5 axes x1y2 with points pt 7 ps 0.6 title 'cd', \
0.30 + 0.25*exp(-x/25)*cos(x/6) axes x1y2 dt 2 title 'model'axes x1y2plots an item against the second y axis, autoscaled on its items alone.- As in gnuplot, the y2 ticks are off until
set y2tics;set ytics nomirrorkeeps the y ticks off the right border.set y2label,set y2range,set logscale y2andset format y2work as for y. - An item that is not a quoted file is a function of
x, with the operators ofusingexpressions. It is sampled atset samplespoints (100) over the x range of the data — here the iterations, 1 to 120 — and titled as written. Functions are drawn with lines unlesswithorset style functionsay otherwise.
What you learned
A second y axis and model functions over data. Reference: gnuplot Subset, Functions.
Next: 7. A dashboard.