Skip to content

B3. Readouts ​

Goal: the few numbers a long run is watched for, large enough to read across the room, over its history.

gnuplot
# the numbers a long run is watched for, as seven-segment readouts over the convergence history
set terminal svg size 700,400 theme vfd
set output 'pb03.svg'
set multiplot title 'RUN MONITOR'
set origin 0,0.66; set size 1,0.34
set readout horizontal
plot 'run.dat' u 1 w readout format '%4.0f' t 'ITER', \
     '' u 2 w readout format '%9.2e' t 'CONTINUITY', \
     '' u 5 w readout format '%6.4f' t 'CD'
set origin 0,0; set size 1,0.66
set logscale y; set format y '10^{%L}'; set grid; set key top right
plot 'run.dat' u 1:2 w l lw 2 t 'continuity', '' u 1:3 w l lw 2 t 'momentum'
unset multiplot
pb03
open SVG ↗

Why it works ​

  • with readout shows the last value of a column as a seven-segment display; the format fixes its digits, the unlit segments the glass (%9.2e: nine digits, all shown, those not used dim).
  • set readout horizontal lines the readouts up in their panel; vertical stacks them.
  • theme vfd draws in the colors of a 1980s car dashboard, a light trace on black, legible on a monitor left on the side of a desk; lcd is the gray of a calculator.
  • Under --watch, the readouts change with the log: the newest iteration, the newest residual.

Try this ​

  • with gauge range [0:0.6] segments 24 for the drag coefficient: a dial with its bands.
  • theme lcd and set terminal dumb: the same readouts in a terminal, drawn with characters.
  • From Fortran: call fig%plot(x, y, with='readout', format='%6.4f', title='CD').

Pitfalls ​

  • A readout's format needs a field width (%6.4f, not %.4f): it is the number of digits of the glass.
  • A readout shows one number: the last row of the column. Read the history from the plot under it.

Reference: readouts, themes. Next: B4. In the terminal.

foresight is available under your choice of license: GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT (License).