# Frame ticks require either 1 or 3 or more labels?

When labeling FrameTicks with my own labels, I stumbled upon a very curious behavior. If I label just one tick, it renders perfectly:

Plot[x, {x, 0, 1}, Frame -> {True, True, False, False},
FrameTicks -> {{{0, "Low"}, 1}, Automatic}]


But if I want to specify both label names, it fails:

Plot[x, {x, 0, 1}, Frame -> {True, True, False, False},
FrameTicks -> {{{0, "Low"}, {1, "High"}}, Automatic}]


"A tick position in the value of the Ticks option should be a number."

However, if I specify 3 or more labels, it all goes back to normal.

Plot[x, {x, 0, 1}, Frame -> {True, True, False, False},
FrameTicks -> {{{0, "Low"}, {0.5, "Medium"}, {1, "High"}}, Automatic}]


I can fix it of course by doing:

Plot[x, {x, 0, 1}, Frame -> {True, True, False, False},
FrameTicks -> {{{0, "Low"}, {0.5, ""}, {1, "High"}}, Automatic}]


But this is not an elegant solution. Is that a bug or there is a reason for that?

This is a bit confusing. In older versions of Mathematica, the syntax for FrameTicks (and for Frame) was:

FrameTicks -> {bottom, left, top, right}


The new syntax is

FrameTicks -> {{left, right}, {bottom, top}}


For legacy reasons, the old syntax for FrameTicks is still supported. So, this is why your Frame specification shows the bottom and left frames. On the other hand, while the FrameTicks specification for your 1-label example matches the old syntax, the 2-label example matches the new syntax (with malformed ticks), and then the 3-label example again only matches the old syntax.

It would probably be good to get used to the new syntax and use it consistently. For the two label example it would be:

Plot[x, {x, 0, 1}, Frame -> {{True, False}, {True, False}},
FrameTicks -> {{Automatic, None}, {{{0, "Low"}, {1, "High"}}, None}}]


• Just beat me to the punch, was just making image ;). – Feyre Jan 27 '17 at 21:09
• Awesome! This explains it very nicely! – Stitch Jan 27 '17 at 21:18