3
$\begingroup$

I'm using a RegionFunction like in the example below, and in the past, and in the Mathematica documentation (from where the code is copied, ContourPlot3D>Options>BoundaryStyle), the RegionFunction is not visible. But when I run this in my Mathematica, it is, and I can't figure out how to make it vanish. See print screens for comparison.

ContourPlot3D[x^2 + y^2 - z^2, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, BoundaryStyle -> Red, Mesh -> None,  RegionFunction -> Function[{x, y, z, w}, x^2 + y^2 + z^2 <= 4]]

My Plot Example in Documentation

$\endgroup$
5
$\begingroup$

Use RegionBoundaryStyle -> None.

ContourPlot3D[x^2 + y^2 - z^2, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
 BoundaryStyle -> Red, Mesh -> None, 
 RegionFunction -> Function[{x, y, z}, x^2 + y^2 + z^2 <= 4], 
 RegionBoundaryStyle -> None]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Thank you! That fixes it. Is the example code in the documentation old, or any idea why it does not provide the same result? $\endgroup$ Sep 2 '21 at 14:49
  • 2
    $\begingroup$ I don't know how often (or when) WRI reevaluates the examples in the documentation. But yes, it looks like the output of this particular example has not been updated (this should probably have happened in 12.1 when RegionBoundaryStyle was added). $\endgroup$
    – Domen
    Sep 2 '21 at 14:53

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.