# Axes Origin & Labels in 3D Plot

I'm looking for a way to have the axes at the origin in a 3D plot and to label the (x,y,z) axes in the usual way---with x near the end of the drawn portion of the x axis, y near the end of the drawn portion of the y axis, etc. I've tried

Plot3D[x^2 + y^2 + 3, {x, -3, 3}, {y, -3, 3},
AxesOrigin -> {0, 0, 0}, PlotRange -> {-1, 20}, AxesLabel -> {x, y, z}]


which works well for the axes position but horribly for the labeling. (The labels appear all together near the origin; it is not at all clear which axis is associated with which label.) Any suggestions?

• In Mathematica 11, the labels position themselves automatically at the ends of the axis when AxesOrigin is specified. (Although, the labels are not always at the positive ends of the axes.) Feb 6, 2018 at 14:23

With Scaled position:

Show[{Plot3D[x^2 + y^2 + 3, {x, -3, 3}, {y, -3, 3},
AxesOrigin -> {0, 0, 0}, PlotRange -> {-1, 20}],
Graphics3D[{Text["x", Scaled[{-.05, .5, 0}], {0, -1}],
Text["y", Scaled[{.5, -.05, 0}], {0, -1}],
Text["z", Scaled[{.5, .5, 1.1}]]}]}, Boxed -> False]


You can add them manually:

Show[{Plot3D[x^2 + y^2 + 3, {x, -3, 3}, {y, -3, 3},
AxesOrigin -> {0, 0, 0}, PlotRange-> {-1, 20}],
Graphics3D[{Text["x", {3, 0, 0}], Text["y", {0, 3, 0}], Text["z", {0, 0, 20}]}]}]


Mess around with the Text[ ] functions to change sizes and positions. I'm sure there must be a better way, though.

• using Scaled location can help to place labels: Show[{Plot3D[x^2 + y^2 + 3, {x, -3, 3}, {y, -3, 3}, AxesOrigin -> {0, 0, 0}, PlotRange -> {-1, 20}], Graphics3D[{Text["x", Scaled[{-.1, .5, 0}]], Text["y", Scaled[{.5, -.1, 0}]], Text["z", Scaled[{.5, .5, 1.1}]]}]}] Mar 18, 2013 at 18:41
• That's a good and scalable (pun not intended) solution. I knew there must be improvements. Mar 18, 2013 at 18:48
• @halmir, please feel free to post that as an answer, too. Mar 18, 2013 at 20:28