pyplot删除零的数字(从0开始而不是0.00) [英] pyplot remove the digits of zero ( start from 0 not 0.00)
本文介绍了pyplot删除零的数字(从0开始而不是0.00)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的x轴标签是
0.00 0.01 0.02 0.03
等等.如何将其格式化为:
etc. How can I format it as:
0 0.01 0.02 0.03
好吧,我试过了:
plt.xlim([0,0.03])
plt.xticks(np.arange(0, 0.03, 0.01))
两者都不起作用.我认为应该将其固定,0.00是没有意义的.
neither does work. I think this should be fixed, 0.00 is meaningless.
推荐答案
你用过 plt.yticks([0, 0.01, 0.02, 0.03], ['0', '0.01', '0.0.2','0.03'])
吗?
这篇关于pyplot删除零的数字(从0开始而不是0.00)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文