個々のサブプロットの色を変更したい:
1. プロットの希望の色を手動で指定する
2. ランダムな色を使用する
基本コード ( 1から取得)
df = DataFrame(np.random.randn(1000, 4), index=ts.index, columns=list('ABCD'))
df = df.cumsum()
df.plot(subplots=True)
plt.legend(loc='best')
plt.show()
私はこれを試しました:
colors = ['r','g','b','r'] #first option
colors = list(['r','g','b','r']) #second option
colors = plt.cm.Paired(np.linspace(0,1,4)) #third option
df.plot(subplots=True, color=colors)
しかし、それらはすべて機能しません。2つ見つかりましたが、これを変更する方法がわかりません:
plots=df.plot(subplots=True)
for color in plots:
??????