2017-09-18 5 views
0

私の質問を正しく質問する方法がわかりません。 ログログプロットでカスタムx、yティックを設定しようとしています。私は答えhere後 、Matplotlibがログログプロットのティックラベルを重複しています

fig1, ax1 = plt.subplots() 
ax1.plot([10, 100, 1000], [1,2,3]) 
ax1.set_xscale('log') 
ax1.set_yscale('log') 
ax1.set_xticks([20, 200, 500]) 
ax1.set_yticks([1, 2,3]) 
ax1.get_xaxis().set_major_formatter 
    (matplotlib.ticker.ScalarFormatter()) 
ax1.get_yaxis().set_major_formatter 
    (matplotlib.ticker.ScalarFormatter()) 

これは軸の上で重複ticklabelsになります。 これはなぜ起こっているのですか?

output

+0

私は検索の多くの後、解決策を見つけることができませんでしたので。私はそれを投稿した。 重複としてマークして元のファイルを指していただきありがとうございます。 –

答えて

0

これは、関連するgithubの問題です: https://github.com/matplotlib/matplotlib/issues/8386

クイックソリューション:

ax.yaxis.set_major_formatter 
    (matplotlib.ticker.ScalarFormatter()) 
ax.yaxis.set_minor_formatter 
    (matplotlib.ticker.NullFormatter()) 
関連する問題