2017-03-25 1 views
1

인덱스 (시간)와 열 (비율)이있는 DataFrame이 있습니다. 나는 히스토그램 플롯에서 x- 틱으로 Time을 사용하고 y 축으로 Rate를 사용하고 싶습니다.DataFrame 인덱스를 x 축 틱으로 사용

data = pd.DataFrame.from_dict(rates,orient='index') 
data.index.name = 'Time' 
data.columns = ['Rate'] 
data.plot(kind='hist', x = data.index.values) 

print(data)가 생산 :

  Rate 
Time   
0  1.191309 
1  1.208280 
2  1.244835 
3  1.279342 
4  1.307912 
5  1.532720 
+0

이 시도 :'data.plot.hist을()'보이지 않았다 – MaxU

+0

변경하기 아무것도 –

+0

당신은 무슨 계획을 세우고 싶은가요? 모자가 현재의 문제/문제입니까? – MaxU

답변

1

데모 :

import matplotlib.pyplot as plt 
import matplotlib 
matplotlib.style.use('ggplot') 

소스 DF :

In [122]: data 
Out[122]: 
      Rate 
Time 
0  1.191309 
1  1.208280 
2  1.244835 
3  1.279342 
4  1.307912 
5  1.532720 
,536,913 여기

는 내가 지금까지있어 무엇인가 63,210

Bar-plot :

In [126]: data.plot.bar(rot=0) 
Out[126]: <matplotlib.axes._subplots.AxesSubplot at 0xe1fe048> 

enter image description here

Histogram plot :

In [131]: data.plot.hist(rot=0) 
Out[131]: <matplotlib.axes._subplots.AxesSubplot at 0xe7611d0> 

enter image description here