plotext is a Python library that enables direct plotting on the terminal, offering a syntax highly similar to Matplotlib. It has no external dependencies for its core functionality and also provides a simple command-line tool for quick plotting. The library is actively maintained, with its latest version 5.3.2 released in September 2024, and features regular updates and improvements.
pip install plotextVerified import paths — ran on the pinned version, not inferred.
This example generates a simple sine wave and plots it directly in the terminal, demonstrating basic line plotting, title, and axis labels.
Review the official documentation for version 5.0+ to update function calls and subplot logic. For `clear_plot()`, use `plt.clear_figure()`. For `xaxis()`, use `plt.xaxes()`. If using `span()`, find an alternative method for your specific use case.
If specifying marker styles, update 'small' to 'hd' where applicable. Consult documentation for other renamed or altered features introduced in 4.0.
Ensure your terminal uses a font that supports a wide range of Unicode characters (e.g., DejaVu Sans Mono). Alternatively, use more universally supported markers, or consider adjusting `plotext.markers()` for compatible options.
Avoid calling `plotext.show()` on an empty plot, especially in interactive modes. Ensure data is present or use `plotext.clear_figure()` and then plot new data explicitly after an empty `show()` call.
After the first call to `show()` or `build()` with a logarithmic scale, reset the problematic scale back to 'linear' using `plt.xscale('linear')` or `plt.yscale('linear')` before subsequent display calls.Replace `plt.figsize()` or any usage of `figsize` with `plt.plotsize()`.
Ensure your terminal supports UTF-8 encoding and has a font capable of displaying Unicode block characters (e.g., DejaVu Sans Mono). For Windows PowerShell, consider using `plt.nocolor()` to avoid color-related character issues, or try running in a different terminal.
After the first call to `plt.show()` (or `plt.build()`) with a logarithmic scale, reset the scale back to 'linear' before subsequent calls to `plt.show()`. Example: `plt.xscale('log'); plt.plot(...); plt.show(); plt.xscale('linear'); plt.show()`Update your code to use the correct function name: `plt.datetimes_to_strings()`.
No dependency data recorded yet.