2017-08-03 22 views
0

透明傳說我檢查了大熊貓的資料繪製與pandas.plot

pd.df.plot

,但我找不到任何選項,以使傳說透明

我知道如何與matplotlib

subplot.legend(loc='best', fancybox=True, framealpha=0.5) 

,但我需要使用熊貓數據幀情節

有什麼想法?

回答

3

Plotting a Pandas DataFrame返回一個Matplotlib axis對象。這個保存到一個變量,然後後來調整傳說設置:

ax = df.plot() 
ax.legend(loc='best', fancybox=True, framealpha=0.5) 

例子:

import pandas as pd 
import matplotlib 

df = pd.DataFrame({"A": [0,1]}) 
ax = df.plot() 
ax.legend(loc='best', fancybox=True, framealpha=0.5) 
ax.plot() 

enter image description here

+0

如果這個工作你能笑納答案嗎? – harryscholes