是否可以修剪matplotlib对数轴上最低的刻度?目前,修剪会关闭所有主要刻度线。
from matplotlib import ticker
x = np.logspace(0, 3, 101)
y = np.log10(x)
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set_xscale("log")
nbins = len(ax.get_xticklabels())
ax.xaxis.set_major_locator(ticker.MaxNLocator(nbins=nbins, prune="lower"))