3
$\begingroup$

I'm on 12.3.1 for Mac OS X x86 and I occasionally see an extra contour appearing in my plot SliceContourPlot3D. Same with Wolfram Cloud, 12.3.0 on Linux.

Minimal example is below. Any suggestion how to get rid of it?

SliceContourPlot3D[x (0.75` x - 0.25` y) + (-0.25` x + 0.75` y) y, 
 z == -.2, {x, -1, 3}, {y, -1, 3}, {z, -1, 1}, ContourShading -> None,
  Contours -> {1.6, 2.5}]

enter image description here

$\endgroup$

1 Answer 1

4
$\begingroup$

Add the option PlotRange -> {0, All}

SliceContourPlot3D[x (0.75` x - 0.25` y) + (-0.25` x + 0.75` y) y, 
 z == -2/10, {x, -1, 3}, {y, -1, 3}, {z, -1, 1}, 
 ContourShading -> None, Contours -> {2.5, 1.6}, 
 PlotRange -> {0, All}]

enter image description here

Alternatively, use PlotRange -> All + BoundaryStyle -> None to get

enter image description here

$\endgroup$
4
  • $\begingroup$ Thanks, that fixes it. But why? :) $\endgroup$ Sep 4, 2021 at 10:57
  • $\begingroup$ @YaroslavBulatov, I suspected the issue had something to do with the automatically computed function range as in the 2D cases ContourPlot[1/(x^2 + y^2), {x, -2, 2}, {y, -2, 2}, Contours -> {.5}] . In 2D default value for BoundaryStyle is None ; ContourPlot[1/(x^2 + y^2), {x, -2, 2}, {y, -2, 2}, Contours -> {.5}, ContourShading -> None] gives a single contour as it should. If we add BoundaryStyle -> Automatic we get what seems like two contours (the spurious one is part of the boundary). For SliceContourPlot3D the default value of BoundaryStyle is Automatic and that of ... $\endgroup$
    – kglr
    Sep 4, 2021 at 11:36
  • $\begingroup$ PlotRange is {Full, Full, Full, Automatic}. In 2D, PlotRange -> All gets rid of the spurious contour. For SliceContourPlot3D, for some reason, we need to also set BoundaryStyle -> None or set PlotRange to {0,All}. $\endgroup$
    – kglr
    Sep 4, 2021 at 11:45
  • 1
    $\begingroup$ Similar to this: mathematica.stackexchange.com/questions/135629/… $\endgroup$
    – Syed
    Sep 4, 2021 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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