Plot Inspection
plotext exposes a small set of helpers for poking at the live state of a plot, useful when investigating layout problems or profiling renders.
Subplots Log
The
log() method, available on any plot or subplot, prints that plot and every nested subplot, one indented line each, showing position, size and grid.The same method on
plotext.terminal prints the tree from the top, the terminal included.For example, on the plot of the subplots page example:
fig.log()
Timing
The time() method prints a timing report of the most recent show() or build(): the total elapsed time and, when full is True (the default), a per-step breakdown for each profiled section.
Note
build() renders the figure and gives back its matrix, the grid of colored characters, which can be sliced, stacked, printed and saved.
import plotext as plt
fig = plt.figure
fig.clear()
fig.draw(fig.signal(plt.sin()).lines())
fig.show()
fig.time()
Caution
This is a developer oriented tool, meant for investigating slow renders more than for everyday plotting.