Skip to main content

Module terminal_plot

Module terminal_plot 

Source
Expand description

Plots rendered as text for terminals.

Curves are drawn on a Braille-dot canvas (each character cell holds 2×4 dots), which gives four times the vertical and twice the horizontal resolution of one-character-per-point plots. Axes carry min/mid/max tick labels, and several series can be overlaid (distinguished by a legend and, optionally, ANSI colour).

See the book entry Shared types, constants and utilities.

Structs§

PlotOptions
Layout options for render_terminal_plot.
PlotSeries
One curve: paired x and y samples, drawn as connected line segments.
PolarSeries
One curve of a polar plot: angles (radians, measured from the plot’s +x direction, counter-clockwise) and values in dB.

Functions§

generate_terminal_plot
Plots a single curve y(x) with default styling at the given size in character cells.
render_polar_plot
Renders a polar plot of dB values, the usual way to show antenna pattern cuts. The radius is value - floor_db (values below the floor sit at the centre), reference rings mark the peak and every ring_step_db below it (0 for none), and the frame keeps a true circular aspect (Braille dots are square when a character cell is twice as tall as it is wide). width is in character cells; the height is chosen from it.
render_terminal_plot
Renders one or more series as a multi-line string (no trailing newline).