import numpy as np
import matplotlib.pyplot as plt
# Try to reproduce the figure shown in images/exercise_1-1.png
# Our data...
x = np.linspace(1, 10, 99)
y1, y2, y3 = np.cos(x), np.cos(x + 1), np.cos(x + 2)
names = ['Signal 1', 'Signal 2', 'Signal 3']
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([x], [y1], color='lightblue', linewidth=3)
plt.show()
我已经尝试了所有可能的方式,但它不会显示。有人得到小费吗?
输出: