import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-3, 3, 50)
y = np.cos(x)
plt.figure(num=3, figsize=(8, 5))
y1 = np.sin(x)
l1, = plt.plot(x, y, label='linear line') # 返回列表
l2, = plt.plot(x, y1, color='red', linewidth=2.0, linestyle='--', label='square line')
# plt.legend(loc='upp
matplotlib速记
最新推荐文章于 2023-10-08 15:19:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)