2

Pretty simple, I want minor ticks on my subplot on the xaxis, but not the yaxis. I've tried all sorts (there seem to be hundreds of methods for ticks) but all seem to want me to specify the locations for the ticks, or use a TickLocator. I just want them on, and not to have to specify where (just like how the Major ticks work automatically).

Something like:

axis.set_minor_xticks_on()

or

axis.xaxis.set_minor_ticks()

or

axis.set_ticks(which='minor', True)

seems so simple but these don't work and I can't seem to find an equivalent. Surely there is one? I don't want labels on the minor ticks.

Using Python 3.5.2 and Matplotlib 1.5.3

Ben Jones
  • 555
  • 6
  • 22
  • 1
    I think this maybe helpful: [how-to-turn-on-minor-ticks-only-on-y-axis-matplotlib](http://stackoverflow.com/questions/12711202/how-to-turn-on-minor-ticks-only-on-y-axis-matplotlib) – AndreyF Jan 18 '17 at 14:45
  • Thanks, that helped – Ben Jones Jan 18 '17 at 15:15

1 Answers1

6

I managed to achieve what I wanted to achieve with:

ax.minorticks_on()
ax.tick_params(axis='x', which='minor', direction='out')
Ben Jones
  • 555
  • 6
  • 22