Matplotlib

Contents

Matplotlib#

matplotlib是一个流行的python绘图库。

A Simple Plot#

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 10, 100)
y = np.sin(x)

plt.plot(x, y)
plt.title("Simple Sine Wave")
plt.xlabel("x")
plt.ylabel("sin(x)")
plt.show()
../_images/8f3befd7dc1bad93c4b2e4d0fbc068b1d4aacba0ceaec6569e09632304761d7a.png