Credits Overview Plotting Styles Commands Terminals

block

The block terminal generates pseudo-graphic output using Unicode block or Braille characters to increase the resolution. It is an alternative for terminal graphics. It requires a UTF-8 capable terminal or viewer. Drawing uses the internal bitmap code. Text is printed on top of the graphics using the dumb terminal's routines.

Syntax:

        set term block
                {dot | half | quadrants | sextants | octants | braille |
                  sextpua | octpua}
                {{no}enhanced}
                {size <x>, <y>}
                {mono | ansi | ansi256 | ansirgb}
                {{no}optimize}
                {[no]attributes}
                {numpoints | charpoints | gppoints}
                {[no]animate}

size sets the terminal size in character cells.

dot, half, quadrants, sextants, or braille select the character set used for the creation of pseudo-graphics. dot uses simple dots, while half uses half-block characters. quadrants uses block characters which yield double resolution in both directions. sextants uses 2x3 block characters, and braille uses Braille characters which give a 2x4 pseudo-resolution. octants uses the proposed 2x4 block characters. sextpua and octpua use the sextants or octants, respectively, in the CreativeKorp private-use-area (PUA) which might be only available with their FairfaxHD and KreativeSquare fonts.

Note that the 2x3 block characters ('sextants') have only been included in Unicode 13. Hence, font support is still limited. Similarly for Braille. Usable fonts include e.g. unscii, IBM 3270, GNU Unifont, DejaVu Sans, and, FairfaxHD. 2x4 block characters ('octants') have only been accepted for inclusion in a future Unicode standard in 2022 and are available in the FairfaxHD font.

The ansi, ansi256, and ansirgb options will include escape sequences in the output to output colors. Note that these might not be handled by your terminal. Default is mono. See terminal dumb for a list of escape sequences.

The attributes option enables bold and italic text on terminals or emulators that support these escape sequences, see terminal dumb.

Using block characters increases the pseudo-resolution of the bitmap. But this is not the case for the color. Multiple 'pixels' necessarily share the same color. This is dealt with by averaging the color of all pixels in a charcell. With optimize, the terminal tries to improve by setting both, the background and foreground colors. This trick works perfectly for the half mode, but is increasingly difficult for quadrants, sextants, or octants. For braille this cannot be used.

gppoints draws point symbols using graphics commands. Due to the low resolution of the terminal, this is mostly viable for braille or octant mode, and probably most useful for error bars. charpoints uses Unicode symbol characters instead. Note that these are also always drawn on top of the graphics. numpoints uses super- and subscript numerals to double the vertical resolution. For sextants, points in the character cell's center position have to be drawn using ordinary numerals, though. Note that the bitmap resolution is still different and lines and symbols in general do not align exactly when using charpoints or numpoints.

The animate option resets the cursor position to the top left of the plot after every plot so that successive plots overwrite the same area on the screen rather than having earlier plots scroll off the top. This may be desirable in order to create an in-place animation.