I am attempting to use RegionFunction to trim an implicit surface drawn with ContourPlot3D to only show the portion inside of a sphere (instead of the bounding box from PlotRange). However, when I attempt to do so, the region specified gets shaded in a little - which I do not want. Here's a minimal example showing the issue,

x^2 + y^2 - z^4 - 1 == 0, 
{x, -10, 10}, {y, -10, 10}, {z, -10, 10},
PlotPoints -> 50, Boxed -> False, Axes -> False, 
RegionFunction -> Function[{x, y, z}, x^2 + y^2 + z^2 < 25]

and a screenshot of it below.


The Mathematica documentation does not appear to show this shading of the region, and indeed when I copy/paste the example of a Plot3D with Regionfunction from the documentation it does not show up for me either. I think I have had it working before for ContourPlot3D as well, but cannot find an old example of mine. What is going on?

  • $\begingroup$ Does this happen on a fresh kernel? $\endgroup$ Jun 1, 2020 at 5:19
  • 1
    $\begingroup$ Add the option RegionBoundaryStyle -> None $\endgroup$
    – Bob Hanlon
    Jun 1, 2020 at 5:38
  • $\begingroup$ @BobHanlon - this works! Thanks :) $\endgroup$
    – Steve
    Jun 1, 2020 at 5:41


Your Answer

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

Browse other questions tagged or ask your own question.