plotext

5.3.2 · active · verified Sun Apr 12

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.

Warnings

Install

Imports

Quickstart

This example generates a simple sine wave and plots it directly in the terminal, demonstrating basic line plotting, title, and axis labels.

import plotext as plt
import math

x = [i for i in range(0, 100)]
y = [math.sin(i / 10) for i in x]

plt.plot(x, y)
plt.title("Sine Wave Plot")
plt.xlabel("X-axis")
plt.ylabel("Y-axis")
plt.show()

view raw JSON →