我是python的新手,我正在尝试使用matplotlib在同一个图中绘制多行.我的Y轴的值存储在字典中,我在下面的代码中在X轴上创建相应的值
我的代码是这样的:
for i in range(len(ID)):
AxisY= PlotPoints[ID[i]]
if len(AxisY)> 5:
AxisX= [len(AxisY)]
for i in range(1,len(AxisY)):
AxisX.append(AxisX[i-1]-1)
plt.plot(AxisX,AxisY)
plt.xlabel('Lead Time (in days)')
plt.ylabel('Proportation of Events Scheduled')
ax = plt.gca()
ax.invert_xaxis()
ax.yaxis.tick_right()
ax.yaxis.set_label_position("right")
plt.show()
Run Code Online (Sandbox Code Playgroud)
但是我逐个单独绘制单独的数字.任何人都可以帮我弄清楚我的代码有什么问题吗?为什么我不能生成多行绘图?非常感谢!