Python pandas, Plotting options for multiple lines

后端 未结 3 1199
情深已故
情深已故 2020-12-07 17:50

I want to plot multiple lines from a pandas dataframe and setting different options for each line. I would like to do something like

testdataframe=pd.DataFra         


        
3条回答
  •  暖寄归人
    2020-12-07 18:31

    So I think the answer lies in passing the color and style in the same argument. The following example works with pandas 0.19.2:

    testdataframe=pd.DataFrame(np.arange(12).reshape(4,3))
    testdataframe.plot(style=['r*-','bo-','y^-'], linewidth=2.0)
    

    Unfortunately, it seems that passing multiple line widths as an input to matplotlib is not possible.

提交回复
热议问题