|||
refer to: https://blog.csdn.net/weixin_44047008/article/details/121192130
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
fig = plt.figure()
ax = fig.add_subplot(111)
x = np.linspace(0, 300, 20)
y = np.linspace(0,300, 20)
y = y*1e16
ax.plot(x,y)
ax.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2f'))
plt.show()
————————————————
版权声明:本文为CSDN博主「weixin_44047008」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_44047008/article/details/121192130
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-4 03:47
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社