# Plot3D producing wrong axis labels

Bug introduced in 10.0 and persisting through 11.0

This is some rather perplexing behaviour. If I try to specify labels for the axes of a 3D plot, sometimes they will go completely belly up:

Plot3D[
x^2 - y^2
, {x, -1, 1}, {y, -1, 1}
, AxesLabel -> {"a", "b"}
]


Note the axis labels have nothing to do with the specified ones. What is going on here?

• @Szabolcs Is that a fact? Pretty neat. What's the nature of the fix? Does the code above now work? Does it print an error? Or is it just a docs fix? – Emilio Pisanty Aug 9 '16 at 14:54
• I just noted that it is still not fixed in 11.0. No fix. – Szabolcs Aug 9 '16 at 14:57
• hah. I misread 'persisting' as 'fixed'. To be honest I'm not completely sure this crosses the line from 'unfriendly syntax' over into 'bug' territory, but it would be nice to at least have a warning printed when an option setting is incorrect and being ignored. – Emilio Pisanty Aug 9 '16 at 15:01
• Yes, there should be a warning, plus it works in 9.0 ... – Szabolcs Aug 9 '16 at 15:04
• No ... ! Noone has time for that. I just checked a few random ones because I was curious. – Szabolcs Aug 9 '16 at 15:52

This is a minor bug, acknowledged by WRI and present as of v10.4. The problem is that for Plot3D the required syntax for AxesLabel is a list with three entries instead of two. When given a two-member list as an argument, though, Plot3D silently interprets that as the AxesLabel→Automatic setting, and it labels the axes with the internal variables of the plot, without even issuing a warning about the wrong syntax.

This behaviour is rather unfortunate and rather difficult to catch (particularly if, say, the specified label were something like

AxesLabel -> {Style["x", FontSize->16], Style["y", FontSize->16]}


which will look like the formatting is not taking effect), but hopefully this waymarker will help some other lost soul in the future.

For the case at hand, though, entering

Plot3D[
x^2 - y^2
, {x, -1, 1}, {y, -1, 1}
, AxesLabel -> {"a", "b", ""}
]


with an empty "" in the third position, will solve the problem.

• FYI AxesLabel -> {"a", "b", Automatic} works too. – Chip Hurst Jun 10 '16 at 14:17
• Yeah, that will also do it. The pitfall is that you need to put something in there (even Null works), but this can be hard to detect if you've got big hulking expressions with lots of formatting, say, in the first two entries. – Emilio Pisanty Jun 10 '16 at 14:23