Normally the Z axis is plotted from bottom-to-top as shown below :
I got a plot with the axis (axes to be more precise) reversed as shown below:
Is there a way to force the axes to be plotted top-to-bottom?
Thanks!
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityMathematica graphics is interactive. Just drag & rotate the plot with mouse till you flip it up side down. You also can do this programmatically:
Plot3D[Sin[x y]^2, {x, -2, 2}, {y, -2, 2}, ViewPoint -> {-1, -2.5, -1},
ViewVertical -> {0, 0, -1}]
Here is how I got these options - if you are curious. Produce Mathematica 3D graphics object and play with it by rotating it around. As soon as you like its orientation excute
Options[%]
And get something like this:
Out[2] = {Axes -> True, BoxRatios -> {1, 1, 0.4}, Method ->
{"RotationControl" -> "Globe"}, PlotRange -> {{-2, 2}, {-2, 2}, {0., 1.}},
PlotRangePadding -> {Scaled[0.02], Scaled[0.02], Scaled[0.02]},
ViewPoint -> {-1, -2.5, -1}, ViewVertical -> {0, 0, -1}}
Options ViewPoint
and ViewVertical
will be most important for your particular case. You can use them now in your code to avoid the need to adjust graphics interactively every time.
NOTE (thanks to @Heike comment below):
In some cases if Options[%]
does not work you may try this:
which will produce the set of options I showed above.
ViewPoint
and ViewVertical
aren't updated on my system when I evaluate Options[%]
after rotating the plot. The only way I can get the updated values is to wrap Options[]
directly around the actual plot, rotate the plot, and re-evaluate the whole expression.
$\endgroup$
– Heike
Mar 14 '12 at 21:02
Using ScalingFunctions
Plot3D[Sin[x y]^2, {x, -2, 2}, {y, -2, 2},
ScalingFunctions -> {Identity, Identity, "Reverse"}]