4
如何更改matplotlib中y軸上方的sci符號的大小?如何更改matplotlib中y軸上方的sci符號的大小?
下面是四個子圖的基本代碼和圖像,我無法弄清楚如何在y軸上方減小sci功率符號的大小。
任何建議,將不勝感激
import matplotlib.pyplot as plt
import numpy as np
def plot():
#plot data
ax.plot(np.arange(0,10000,100),np.arange(0,10000,100))
#set label style
ax.ticklabel_format(style='sci',axis='y')
ax.yaxis.major.formatter.set_powerlimits((0,0))
#format labels/ticks
ax.tick_params(axis='x',tick1On=True, tick2On=False, label1On=True,
label2On=False, labelsize=7,color='black')
ax.tick_params(axis='y', tick1On=True,tick2On=False, label1On=True,
label2On=False, labelsize=7,color='black')
fig = plt.figure()
ax = fig.add_subplot(2,2,1)
plot()
ax = fig.add_subplot(2,2,2)
plot()
ax = fig.add_subplot(2,2,3)
plot()
ax = fig.add_subplot(2,2,4)
plot()
plt.tight_layout()
fig.subplots_adjust(left=None, bottom=None, right=None, wspace=0.15, hspace=0.22)
plt.show()
太棒了 - 就是這樣!我沒來過plt.rc()。非常感謝 – user1665220
這可能對未來有用:http://matplotlib.org/users/customizing.html – Victoria