I would like to make a nice 3D graphic of a parabolic bowl, with a cylindrical rim. If I do the following:

Plot3D[x^2 + y^2, {x, -3, 3}, {y, -3, 3}]

I get a paraboloid, but the box is rectangular, so the edges come to points. I want a cylindrical bounding box. The best I've come up with is this:

Plot3D[Piecewise[{{x^2 + y^2, x^2 + y^2 < 1}}], {x, -1, 1}, {y, -1, 1}]

This creates a bowl, but there is also a "floor" to the graphic that I would like to get rid of. I might be able to play games with the coloring, but that seems like a poor hack. Does anyone have any suggestions?

More generally, is it possible to create a 3D bounding box of arbitrary shape?

Plot3D[x^2 + y^2, {x, -3, 3}, {y, -3, 3}, 
       RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 9]]

enter image description here

Re: " is it possible to create a 3D bounding box of arbitrary shape?" ... as arbitrary as your creativity for creating region functions is

  • $\begingroup$ Thank you so much! That is exactly the option I had been unable to find. $\endgroup$ – jmizrahi Jun 18 '13 at 2:27
  • $\begingroup$ Alternatively, why not parametrize? ParametricPlot3D[{r Cos[t], r Sin[t], r^2}, {r, 0, 3}, {t, -π, π}] $\endgroup$ – J. M.'s torpor Jun 18 '13 at 3:28
  • $\begingroup$ @0x4A4D Well, the title refers to Plot3D[] ... BTW: why the hex conversion? $\endgroup$ – Dr. belisarius Jun 18 '13 at 3:33
  • $\begingroup$ Well ,my message was more for the OP than you, but anyway... I got hexed, and now you're seeing the effects. $\endgroup$ – J. M.'s torpor Jun 18 '13 at 3:57
  • $\begingroup$ @0x4A4D Please keep your true name concealed $\endgroup$ – Dr. belisarius Jun 18 '13 at 11:55

The shorter the better :) :

RevolutionPlot3D[t^2, {t, 0, 3}]

enter image description here

It is good to know RevolutionPlot3D in case of some axisimmetric figures but the true control is given by RegionFuntion introduced by belisarius.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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