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.

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?

share|improve this question

2 Answers 2

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

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

share|improve this answer

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.