# Add minor ticks to custom ticks

So as of now I am using

Ticks -> {Range[0, d, 1]}

where d is the maximum value for my axes.

But the thing is that between 0 and 1 (or other integers) there are no minor ticks. Look here.

I have now only the integers and empty space in between. All I want is to have like five minor ticks. Just so that it looks better. I want to have the major (labeled) ticks only at the integers.

Also could maybe someone tell me how to not have two 0 labels on one plot (one for the x-axis, one for the y-axis)? Again look here.

I've spent an hour looking for the solution, but wasn't able to find a good one.

Plot[1 + x^2, {x, 0, 5},
Frame -> {{True, False}, {True, False}},
FrameTicks -> {{ChartingScaledTicks["Linear"][0, 25, {5, 5}],
None}, {ChartingScaledTicks["Linear"][0, 5, {5, 5}], None}}]


To remove one of two ticks with label 0 at the origin use

FrameTicks -> {{ChartingScaledTicks["Linear"][0.5, 25, {5, 5}],
None}, {ChartingScaledTicks["Linear"][0, 5, {5, 5}], None}}


You can also create a custom tick function to use with FrameTicks:

tickFunc = Join[{#, #, {.03, 0}} & /@ Subdivide[##, 5],
{#, " ",  {.01, 0}} & /@ Subdivide[##, 25]] &;

Plot[1 + x^2, {x, 0, 5},
Frame -> {{True, False}, {True, False}}, PlotRangePadding -> 0,
FrameTicks -> {{tickFunc, None}, {tickFunc, None}}]


• Worked like a charm! thank you Jan 30, 2019 at 20:37
• @kglr Trying to extend your first technique for use on a 3D plot gives the error: "A tick position in the value of the Ticks option should be a number." How can your first technique be correctly extended for use with a 3D plot? Oct 1, 2019 at 18:45
• @MichaelB.Heaney, this works: Plot3D[1 + x^2+y^2, {x, 0, 5},{y, 0,5}, Ticks -> {ChartingScaledTicks["Linear"][0,5, {5, 5}], ChartingScaledTicks["Linear"][0, 5, {5, 5}],ChartingScaledTicks["Linear"][0, 50, {2, 5}]}]
– kglr
Oct 2, 2019 at 0:03
• @CATrevillian, thank you for bringing this to my attention. I updated with a method that removes one of the duplicate labels at the origin.
– kglr
Apr 5, 2020 at 3:21
• Side note: syntax of ChartingScaledTicks has changed a bit in higher versions. See: mathematica.stackexchange.com/a/269044/1871 Nov 26, 2022 at 5:33