Skip to content

B4. In the terminal ​

Goal: the run's convergence in the terminal you are logged in with, over ssh, with nothing else installed.

gnuplot
# the convergence in a terminal: Braille dots, 2 x 4 per character cell, over ssh with nothing installed
set terminal block braille size 72,20
set logscale y
set format y '%.0e'
set key top right
plot 'run.dat' u 1:2 w l t 'continuity', '' u 1:3 w l t 'momentum'
text
$ foresight pb04_terminal.gp

  1e+01⣿⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉continuity⢉⣉⣉⣉⣉⣉⠉⡇
       ⣟                                               momentum⢀⣀⣀⣀⣀⣀ ⡇
  1e+00⣷⠢⠤⢄⡀                                                         ⠐⡇
       ⡿⠢⠤⣀⠈⠢⡀                                                        ⡇
  1e-01⣏⡀  ⠑⠢⣈⡒⠤⠤⠤⠤⠤⣀                                                ⢀⡇
       ⣿      ⠈⠉⠉⠒⠒⠒⠤⢕⡢⡀                                              ⡇
       ⡯              ⠈⠙⠦⡤⠤⠤⠤⢄⣀                                       ⡇
  1e-02⣷⠂                ⠈⠑⠒⠤⠤⠤⢕⣄⡀                                   ⠐⡇
       ⣿                         ⠙⠫⠶⢤⡤⠤⣀⡀                             ⡇
  1e-03⣧⠄                            ⠈⠒⠤⢌⣑⢄                          ⠠⡇
       ⣿                                  ⠉⠙⠭⠵⠶⠤⣤⣀                    ⡇
       ⡗                                         ⠉⠛⠶⣄                 ⡇
  1e-04⣿⠁                                            ⠙⠶⠶⠦⠤⢤⣀⣀        ⠈⡇
       ⣟                                                   ⠈⠉⠫⡒⢄⡀     ⡇
  1e-05⣧⠄                                                     ⠈⠒⠬⣑⡤⢤⣀⣠⡇
       ⣟                                                             ⠈⡇
  1e-06⣏⣀⣀⣀⣀⣀⣀⣀⣀⣀⣠⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣄⣀⣀⣀⣀⣀⣀⣀⣀⣀⣠⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣄⣀⣀⣀⣀⣀⣀⣀⣀⣀⣠⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡇
       0        20         40        60         80        100        120

Why it works ​

  • set terminal block braille draws with Unicode Braille characters, 2 x 4 dots each: four times the resolution of dumb's characters, in any terminal with a Unicode font.
  • The text — tick labels, the key — is written over the graphics in the character cells.
  • foresight --watch pb04_terminal.gp clears the screen and redraws in place at each change of the log: a live plot over plain ssh, no X forwarding, no port to open.

Try this ​

  • set terminal block braille ansirgb: the series in colors.
  • set terminal dumb size 72,22: plain ASCII, for a log file or an e-mail.
  • set terminal block quadrants: 2 x 2 blocks, coarser and heavier.

Pitfalls ​

  • The default tick labels of a log axis are gnuplot's % h, long in a text terminal (10.000000, as gnuplot 6.0 writes them): set format y '%.0e' as above.
  • A terminal narrower than the plot wraps its lines: give size the terminal's columns and rows.

Reference: text terminals, cookbook. Next: B5. Numbers on the plot.

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