Skip to content

7. A dashboard ​

One panel per quantity, side by side: the residuals, and the drag coefficient with its error bars.

gnuplot
set multiplot layout 1,2 title 'Run monitor'
set title 'residuals'
set logscale y; set grid
plot 'run.dat' u 1:2 t 'continuity', '' u 1:3 t 'momentum', '' u 1:4 t 'energy'
set title 'drag coefficient'
unset logscale y
plot 'run.dat' u 1:5:6 every 4 with yerrorbars pt 7 ps 0.5 t 'cd'
unset multiplot
wheel: zoom · drag: pan · right drag: box · a resetopen page ↗
  • set multiplot layout ROWS,COLS lays out a grid; each plot fills the next panel, with the settings in force, so unset logscale y before the second plot affects that panel only. unset multiplot closes it.
  • with yerrorbars takes a third column, the error: x:y:dy (or x:y:low:high). xerrorbars and xyerrorbars work the same way. The bar caps keep their size when you zoom.
  • In the page, the pointer picks the panel. Both panels plot iterations 0 to 120, so they share their x axis: a zoom on one shows the same iterations on the other, each keeping its own y (l unlinks them). Try a box zoom (right drag) on the residuals.

An inset ​

Without layout, each panel lies in the box of its set origin and set size, page fractions: a zoom of the last iterations over the whole history.

gnuplot
set multiplot title 'Drag coefficient'
plot 'run.dat' u 1:5 w l t 'cd'
set origin 0.45,0.12; set size 0.5,0.45
unset key; set xrange [80:120]
plot 'run.dat' u 1:5:6 every 2 with yerrorbars pt 7 ps 0.5
unset multiplot
wheel: zoom · drag: pan · right drag: box · a resetopen page ↗

What you learned

Multiplot grids and insets, error bars. Reference: gnuplot Subset; from Fortran, set_multiplot and next_panel in the Fortran Library.

Next: 8. Watching the run.