----------------------------------------------------------------------------------------------------------------------------------------
#设置表颜色和线条灰度值 import matplotlib. pyplot as plt x=[1, 2, 3, 4, 5] y=[10, 20, 30, 40, 50] plt.plot(x,y,color='0.7',linestyle='-.') #设置灰度值为0.7,线条样式为-. plt.show()
#设置表颜色和线条样式 import matplotlib.pyplot as plt x=[1, 2, 3, 4, 5] y=[10, 20, 30, 40, 50] plt.plot(x,y,color='r',linestyle='-.') #设置线条颜色为红色,线条样式为-. #点划线 y=[10, 15, 20, 25, 30] plt.plot(x,y,color='b',linestyle='--') #设置线条颜色为蓝色,线条样式为-- #双划线 y=[10, 13, 16, 19, 22] plt.plot(x,y,color='g',linestyle=':') #设置线条颜色为绿色,线条样式为虚线 #虚线 y=[10, 18, 26, 34, 42] plt.plot(x,y,color='pink',linestyle='-') #设置线条颜色为粉色,线条样式为实线 plt.show()
标签:plot,plt,10,color,73,linestyle,线条,图标 From: https://www.cnblogs.com/988MQ/p/16929796.html