Registry / data / textual-plotext

textual-plotext

JSON →
library1.0.1pypypi✓ verified 87d ago

A Textual widget wrapper for the Plotext plotting library, enabling interactive terminal-based plots within Textual applications. Current version: 1.0.1. Active development.

pip install textual-plotext
INSTALL
IMPORT
SIG · TEXTUAL-PLOTEXT
T
textual-plotext
datapythonv1.0.1
Install
3.5s avg
Import
801ms
Disk
38MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.842s · 38.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.5s · import 0.760s · 39MB
38MB installed
● package 38MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PlotextPlot
from textual_plotext import PlotextPlot
from textual_plotext.plotext import PlotextPlot
PlotextPlot is exported at package level

Create a simple Textual app with a scatter plot.

import asyncio from textual.app import App, ComposeResult from textual_plotext import PlotextPlot class PlotApp(App): def compose(self) -> ComposeResult: yield PlotextPlot(id="plot") def on_mount(self) -> None: plot = self.query_one("#plot", PlotextPlot) plt = plot.plt plt.title("Quickstart Plot") plt.scatter([1, 2, 3], [4, 5, 6]) plt.plot([1, 2, 3], [4, 5, 6]) plot.refresh() if __name__ == "__main__": app = PlotApp() asyncio.run(app.run_async())
Debug
Known issues
gotchaCalling plt.clf() resets the plot size to a default, causing layout flicker. Use plot.clear() instead to reset data while preserving size.
fix
Use the widget's clear() method instead of plotext.clf()
affects: <=1.0.1
gotchaPlotextPlot uses a fixed canvas size; setting widget height/width in CSS may not affect the plot's internal resolution, causing clipping.
fix
Adjust the plot via plt.subplots(height, width) or use proportional sizing in the Plotext plot object.
affects: <=1.0.1
deprecatedThemes prefixed 'textual-' are experimental; future versions may rename them.
fix
Use the builtin plotext themes without prefix, or customize colors.
affects: >=0.2.0 <1.0.0
Errors
Common errors & fixes
AttributeError: module 'plotext' has no attribute 'plt'
PlotextPlot.plt is an instance of plotext.plot.Plot, not the module.
fix
Access plt via the widget instance: plot.plt
TypeError: 'PlotextPlot' object does not support indexing
Trying to use PlotextPlot as a container or callable directly.
fix
Use PlotextPlot as a widget: app.compose() yield PlotextPlot()
Upgrade
Version history
1.0.1latest on PyPI · released Nov 30, 2024
Audit
Dependencies
textualrequiredWidget host framework
plotextrequiredPlotting backend
Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
textual-plotext — pip install textual-plotext · libregistry