我希望得到我的最後情節的顏色如何獲得最新的大熊貓df.plot()繪製線條的顏色
ax = df.plot()
df2.plot(ax=ax)
# how to get the color of this last plot,
#the plot is a single timeseries, there is therefore a single color.
我知道該怎麼做,在matplotlib.pyplot
,對於那些有興趣看到例如here,但我無法找到一種方法來做到這一點在熊貓。在熊貓中有沒有像get_color()
那樣的行爲?
嘗試'ax.get_lines()[ - 1] .get_color()' – Goyo
@Goyo爲什麼它是一個評論,而不是一個答案?如果你宣傳它,我會將其標記爲已接受的答案。 – SirC
因爲我是從記憶中寫下來的,沒有機會去測試它。它爲你工作,所以我詳細闡述了它的答案。 – Goyo