How to set scientific notation on axis in matplotlib

半世苍凉 提交于 2019-12-04 21:40:37

Since you override the ticks, you can format them yourself and rotate them as well for more space:

new_tick_label = ['{:5.2e}'.format(x) for x in leak] 
ax2.set_xticks(new_tick_locations)
ax2.set_xticklabels(new_tick_label, rotation=30)

Result:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!