Matplotlib 中的简单图

此示例说明如何使用 Matplotlib 创建简单的正弦曲线 ****

# Plotting tutorials in Python
# Launching a simple plot

import numpy as np
import matplotlib.pyplot as plt

# angle varying between 0 and 2*pi
x = np.linspace(0, 2.0*np.pi, 101)
y = np.sin(x)                        # sine function

plt.plot(x, y)
plt.show()

样本正弦曲线