Message Boards Message Boards

4 Replies
5 Total Likes
View groups...
Share this post:

3DPlot at discontinuities

Posted 11 years ago
I am trying to plot the 3D graphs of 1/(x+1) function. At the point x=-1 (where function turns to infinity) Mathematica plots a vertical surface. 
I tried to use "Exclusions". It removes the vertical line but there are still two horizontal surfaces near the point of discontinuity.
Can it be avoided anyhow without losing the precision of the graph and cutting the plot? Actualy I need a plot of another function, where I just can't change the plot range for some reasons

Thanks in advance.
4 Replies
The "horizontal surfaces" you refer to seem to be a side effect of Mathematica's attempt to find a good z-range to plot. They can be avoided by specifying the PlotRange like so
Plot3D[1/(x + 1), {x, -2, 2}, {y, 0, 2}, Exclusions -> {x == -1}, PlotRange -> All]
POSTED BY: Marco Thiel
Posted 11 years ago
Plot each segment with a separate Plot3D,
combine those plots with Show
and make appropriate use of PlotRegion so that all the segments appear?

Futzing around trying to make the graphics appear close to what you actually want seems to usually take three to five times longer than just getting the math close to correct. Change that scale factor to ten to infinity when you raise the bar to getting exactly the appearance that you want.
POSTED BY: Bill Simpson
Thanks a lot for your replies.

Marco I think I found a better way:
Plot3D[1/(x + 1), {x, -2, 2}, {y, 0, 2}, Exclusions -> {x == -1},
PlotRange -> {{-2, 2}, {0, 2}, {-5, 5}}, ClippingStyle -> None]
ClippingStyle is an option that specifies the style of what should be drawn when curves or surfaces would extend beyond the plot range.

This way one is free to specify the plot range.

In 14.0.0, you also have

Plot3D[1/(x + 1), {x, -2, 2}, {y, -1, 1}, MaxRecursion -> 4, 
 ClippingStyle -> None]


Plot3D[1/(x + 1), {x, -2, 2}, {y, -1, 1}, 
 Exclusions -> "Singularities", ClippingStyle -> None]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract