系列图 - 将y轴设置为系列值

时间:2016-12-29 10:38:00

标签: python pandas matplotlib

数据:

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

简介:

您能否告诉我为什么y轴没有按照系列值显示格式164.42等的值?

<form name="myForm" ng-submit="myFunction()">
<input name="myInput" ng-model="myInput" type="text" >
<input name="email" ng-model="email" type="email" >

</form>

enter image description here

1 个答案:

答案 0 :(得分:2)

这应该可以解决问题。您必须使用以下符号格式化轴刻度:

from matplotlib.ticker import FormatStrFormatter

ax = today_slice.Last.plot()
ax.yaxis.set_major_formatter(FormatStrFormatter('%.2f'))
相关问题