Interactive Mode
show().interactive() method flips that: while it is on, every figure-mutating call reprints the whole figure immediately, so each change appears without an explicit show() call.import plotext as plt
fig = plt.figure
fig.clear()
fig.interactive() # turn interactive mode on
fig.draw(fig.signal(plt.sin())) # each of these reprints the figure
fig.title("Interactive")
fig.theme("dark")
fig.interactive(False) # back to manual show()
Note
This is the same convenience as matplotlib’s plt.ion(): handy at the interactive Python prompt, when building a plot up step by step.
What triggers a reprint:
Every method changing the figure reprints it once complete:
draw(),line(),event(), and every setting method, liketitle(),theme(),ruler().lim()or the clear family.A single call reprints exactly once, even when it acts on several settings internally, like
clear(), or reaches several subplots at once.The signal creating methods, like
signal()orbar(), only return their signal, leaving the figure untouched: the reprint comes when the signal is passed todraw(), the moment the content actually lands on the figure.
Important
Interactive mode is a session toggle, not a plot setting: it persists across clear() and is switched off only by interactive(False). Enabling it is silent, the next figure-changing call produces the first reprint.