【发布时间】:2017-09-18 14:48:31
【问题描述】:
我不知道如何正确地提出我的问题。 我正在尝试在对数图上设置自定义 x,y 刻度。 按照here我的回答,
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())
这会导致轴上的刻度标签重叠。 有谁知道为什么会这样?
【问题讨论】:
-
由于找不到解决方案,经过大量搜索。我贴出来了。感谢您将其标记为重复并指向原始文件。
标签: python matplotlib anaconda