将y轴标签格式化为具有很多零的高位千位数以科学计数法表示?

问题描述 投票:0回答:1
如何使用科学计数法收紧y轴?

import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) x=[1,2,3,4,5,6,7,8,9,10] y=np.array([1,1,1,2,10,2,1,1,1,1])*100000 ax.plot(x, y)

enter image description here

如何使用科学计数法收紧y轴?导入numpy作为np导入matplotlib.pyplot作为plt图= plt.figure()轴= fig.add_subplot(111)x = [1,2,3,4,5,6,7,8,9,10] y = np.array([1,1,1,...

python matplotlib format axis scientific-notation
1个回答
0
投票
使用plt.ticklabel_format
© www.soinside.com 2019 - 2024. All rights reserved.