Ben*_*nes 1 python plot graph matplotlib
很简单,我希望在 xaxis 上的子图上有小刻度,而不是 yaxis。我已经尝试了各种方法(似乎有数百种方法用于刻度),但似乎所有人都希望我指定刻度的位置,或者使用 TickLocator。我只是想让它们打开,而不必指定在哪里(就像主要刻度如何自动工作一样)。
就像是:
axis.set_minor_xticks_on()
Run Code Online (Sandbox Code Playgroud)
或者
axis.xaxis.set_minor_ticks()
Run Code Online (Sandbox Code Playgroud)
或者
axis.set_ticks(which='minor', True)
Run Code Online (Sandbox Code Playgroud)
看起来很简单,但这些不起作用,我似乎找不到等价物。肯定有吗?我不想要小刻度上的标签。
使用 Python 3.5.2 和 Matplotlib 1.5.3
我设法实现了我想要实现的目标:
ax.minorticks_on()
ax.tick_params(axis='x', which='minor', direction='out')
Run Code Online (Sandbox Code Playgroud)