2016-12-29 46 views
1

數據:系列情節 - y軸的設定值系列

type(today_slice.Last) 
pandas.core.series.Series 

today_slice.Last.head(5) 
Timestamp 
2016-12-29 02:00:00 164.45 
2016-12-29 02:03:00 164.42 
2016-12-29 02:06:00 164.40 
2016-12-29 02:09:00 164.41 
2016-12-29 02:12:00 164.41 
Name: Last, dtype: float64 

簡介:

能否請你告訴我,爲什麼y軸沒有出現在格式164.42等的值每個系列值?

today_slice.Last.plot(yticks=today_slice.Last) 

enter image description here

回答

2

這應該做的伎倆。你必須格式化軸標記:

from matplotlib.ticker import FormatStrFormatter 

ax = today_slice.Last.plot() 
ax.yaxis.set_major_formatter(FormatStrFormatter('%.2f')) 
+0

不錯的,這個固定它。謝謝 :-) – ade1e