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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.842s · 38.5MB
glibcpy 3.10–3.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())
Errors
Common errors & fixes
AttributeError: module 'plotext' has no attribute 'plt'
PlotextPlot.plt is an instance of plotext.plot.Plot, not the module.
fixAccess plt via the widget instance: plot.plt
TypeError: 'PlotextPlot' object does not support indexing
Trying to use PlotextPlot as a container or callable directly.
fixUse 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