Skip to content

Matplotlib

import matplotlib.pyplot as plt
import numpy as np

Simple Plot

x = np.linspace(0, 2, 100)

plt.plot(x, x, label="linear")
plt.plot(x, x**2, label="quadratic")
plt.plot(x, x**3, label="cubic")

plt.xlabel("x label")
plt.ylabel("y label")

plt.title("Simple Plot")

plt.legend()

plt.show()

png