Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Normally the Z axis is plotted from bottom-to-top as shown below : normal z-axis running bottom-to-top

I got a plot with the axis (axes to be more precise) reversed as shown below:enter image description here

Is there a way to force the axes to be plotted top-to-bottom?

Thanks!

share|improve this question

1 Answer 1

up vote 14 down vote accepted

Mathematica 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}]

enter image description here

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:

enter image description here

which will produce the set of options I showed above.

share|improve this answer
    
Well, that's a boring solution. :-) –  Brett Champion Mar 14 '12 at 20:44
    
@BrettChampion I'd be happy to see someone cooking something more entertaining ;-) –  Vitaliy Kaurov Mar 14 '12 at 20:47
    
The values for 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. –  Heike Mar 14 '12 at 21:02
    
@Heike I'm running M. V8.0.4 on Win7 - works for me. What is your system? –  Vitaliy Kaurov Mar 14 '12 at 21:10
    
@VitaliyKaurov I'm using v8.0.4 on OS X. –  Heike Mar 14 '12 at 21:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.