为每行熊猫绘制数据框

时间:2020-02-12 15:00:46

标签: python pandas matplotlib

我需要一个图来收集所有列上每一行的单个线条图,但第一列显示为图例以标识每个线条图。这是我写的for循环。

for i in range(0,5):
    plt.plot(df.iloc[i, 1:], label=df.iloc[i,0])
    plt.legend()

但是,以这种方式y轴却被弄乱了as seen in the picture below, this messes up also the plot that are not correct

0 个答案:

没有答案