python中matplotlib.pyplot.plot作图各种参数

import matplotlib.pyplot as plt

x = [1,2,3,4]
y = [1,2,3,4]
y2 = [2,4,6,8]
#maker/makersize/markerfacecolor/markeredgecolor/color(指的是linecolor)/linestyle/linewidth/markeredgewidth
//plot函数有很多的参数可以选择
//主要有线的类型linestyle
//线的宽度linewidth
//线的颜色color
//maker的样式marker
//marker的各种颜色markerfacecolor/makeredgecolor
//marker的大小markersize/markeredgewidth
//以上各种参数的选择可以在matplotlib.lines.Line2D — Matplotlib 3.4.3 documentation找到
plt.plot(x,y,linestyle = (0,(1,1)),fillstyle = 'none',marker = 10,markeredgewidth = 2,markersize = 15,color = 'k')
plt.plot(x,y2,'-.',marker = '+',color = 'k')//一张图中做两条线就分开写两条线的代码
plt.show()//展示图

 

posted @ 2021-08-23 13:59  Toretto瑞  阅读(365)  评论(0编辑  收藏  举报