2
比方說,我有以下代碼Matplotlib禁用指數符號
import matplotlib.pyplot as plt
plt.figure()
plt.semilogy([0,1],[20,90])
plt.show()
它創建如下圖所示:
我想禁止在y科學記數法(所以我想有20,30,40,60,而不是2x10^1等)
我已經看了this線程,並且我嘗試添加
import matplotlib.ticker
plt.gca().get_yaxis().set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.gca().get_yaxis().get_major_formatter().set_scientific(False)
plt.gca().get_yaxis().get_major_formatter().set_useOffset(False)
但它不會影響結果數字。我正在使用python 3.5.3和matplotlib 2.1.0。我錯過了什麼?
Aaaaah,這就是我失蹤了。非常感謝! :) – arriopolis