0


matplotlib.pyplot plt绘图颜色大全,及plt.plot()的使用

plt颜色大全

在这里插入图片描述

plt.plot()的使用,简单例子

  1. X = np.linspace(1,20,10)#[1 3 5 7 9 11 13 15 17 19] [2 4 6 8 10 12 14 16 18 20]
  2. Y = np.sin(X)
  3. plt.plot(X, Y, color ="blue", linewidth=2, linestyle="-", label="LINE")
  4. plt.legend(loc="upper right")
  5. plt.show()

**

  1. X

: x轴的长度,

  1. 1-20

  1. 10

个点**
**

  1. Y

: 对应

  1. X

  1. 10

个点的数据**
**

  1. color

: 颜色、

  1. linewidth

:线的粗细、

  1. linestyle

:样式、

  1. label

:这条线命名**


本文转载自: https://blog.csdn.net/qq_41138191/article/details/124805133
版权归原作者 BiuPsYao 所有, 如有侵权,请联系我们删除。

“matplotlib.pyplot plt绘图颜色大全,及plt.plot()的使用”的评论:

还没有评论