MATLAB: Unrecognized property ‘TicksBetween’ for class ‘matlab.gr​aphics.axi​s.Axes’.

minor ticks

I get this error while running following
ax=gca;
ax.TickDir = 'out';ax.TickLength=[0.0075, 0.0075];ax.TicksBetween= 1;
I want only one minor tick mark between tick marks, Please suggest me!

Best Answer

As far as I know TicksBetween has never been a property of axes.
You can set the location of the minor ticks by changing the MinorTickValues of the numeric ruler:
ax.XAxis.MinorTickValues = movmean(ax.XAxis.TickValues, 2, 'EndPoints', 'discard');
ax.XAxis.MinorTick = ' on';
will give you exactly one minor tick between each major tick.