Solve Mathematica Plotting Problems: Z-Axis Limits

  • Context: Mathematica 
  • Thread starter Thread starter natski
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around how to set z-axis limits in 3D plots using Mathematica. Participants share their experiences and solutions regarding the PlotRange option and its application in both 2D and 3D plotting contexts.

Discussion Character

  • Technical explanation, Homework-related

Main Points Raised

  • One participant expresses frustration in finding instructions for setting z-axis limits in Mathematica 3D plots, suggesting that the default settings may be inadequate.
  • Another participant proposes using the PlotRange option to specify z-axis limits, providing a syntax example for clarity.
  • A third participant agrees with the previous suggestion, reiterating the use of PlotRange for both 2D and 3D plots and offering additional resources for Mathematica users.
  • A later reply confirms that the provided solution resolved the initial participant's issue, indicating satisfaction with the outcome.

Areas of Agreement / Disagreement

Participants generally agree on the use of the PlotRange option to address the z-axis limit issue, with some expressing confidence in the solution's effectiveness. However, there is no explicit consensus on the default behavior of Mathematica's plotting functions.

Contextual Notes

Some assumptions about the default settings of Mathematica's PlotRange and the specific function being plotted remain unaddressed, which could affect the applicability of the proposed solutions.

natski
Messages
262
Reaction score
2
I have searched the Mathematica bible long and hard and done various searches in the help index of Mathematica but have found nowhere instructions on how to solve my problem.

For a 2D, or in my case 3D plot, you choose the x and y axes easily by setting them in the initial command to plot your function, but there does not seem to be anyway to choose the z axis limits? I am reasonably confident Mathematica is chopping off most of my function and I want to extend the z axis up to higher limits to observe the full plot. Has anyone else experienced this problem?
 
Physics news on Phys.org
What you are probebly looking for is the PlotRange option. You should use it like this:

Code:
Plot3D[f(x,y),{x,min_x,max_x},{y,min_y,max_y},PlotRange->{min_z,max_z}]

Also becouse the default setting of PlotRange is Automatic and it usualy work preaty well, it might be a good idea to reconsieder your x and y renges (make them smaller if you don't REALLY need them that big).

Hope this helped.

PS: This thread might be more sutible for the Computers/Programming forum.
 
Last edited:
Well, I could be wrong, but in the case of the 2D case all you do is use the tag PlotRange->{min,max} as an option. So for 3D I would use the same option and change the PlotRange.

It would look something like:
Plot3D[function, {x,xmin,xmax}, {y,ymin,ymax}, PlotRange->{zmin,zmax}]

Give it a try. There is also a listserve for Mathematica. Send a message asking to be added to it at: mathgroup@smc.vnet.net

Let me know if that works or not.
Cheers,
Norm
 
Seems LENIN is quicker than I.

Well, it seems LENIN and I agree atleast. So it should work.
 
Thank-you, this was very helpful and correcetd my problem. I can't fathom why Mathematica insisted on plotting just bizarre z-axes by default but I have now a nice plot of the correct function.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
17K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K