This is an extended version of a recent post (one in which I neglected to add editable code: apologies). I have found that Mathmatica sometimes adds minor tickmarks and sometimes doesn't. (I'm calling major tickmarks those placed at ticks – either those that are automatically generated or those specified with the Ticks option – and minor tickmarks those that are regularly spaced between major ticks.) Here are two versions of almost identical code (varying primarily in the plotting range, range of gridlines and the number of specified ticks):
Version1: major and minor tickmarks appear
Plot[2 Sin[x], {x, -3, 3},
PlotStyle -> Red,
AxesLabel -> {x, y},
PlotRange -> {-3, 3},
LabelStyle ->
Directive[Black, 14, Italic, FontFamily -> "Times New Roman"],
GridLines -> {Range[-3, 3, 1], Range[-3, 3, 1]},
Ticks -> {-2, -1, 1, 2},
TicksStyle -> Directive[Black, Plain, 12],
AxesStyle -> Arrowheads[{Automatic, Automatic}],
AspectRatio -> 1
]
Version2: major and tickmarks only; no minor tickmarks
Plot[2 Sin[x], {x, -10, 10},
PlotStyle -> Red,
AxesLabel -> {x, y},
PlotRange -> {-11, 11},
LabelStyle ->
Directive[Black, 14, Italic, FontFamily -> "Times New Roman"],
GridLines -> {Range[-10, 10, 1], Range[-10, 10, 1]},
Ticks -> {{-10, -5, 5, 10}, {-10, -5, 5, 10}},
TicksStyle -> Directive[Black, Plain, 12],
AxesStyle -> Arrowheads[{Automatic, Automatic}],
AspectRatio -> 1
]
Can anyone explain this inconsistency or suggest a workaround so that I can get minor tickmarks to appear as well as the major ones? TIA.
Geoffrey