0
$\begingroup$

Compare the two following outputs:

 Plot3D[{Abs[y - x]}, {x, 0, 1}, {y, 0, 12}, 
 RegionFunction -> Function[{x, y, z}, x < y],
 PlotRange -> {0, 12}, 
 MaxRecursion -> 3]

Graphic output: full scale

Plot3D[{Abs[y - x]}, {x, 0, 1}, {y, 0, 12}, 
 RegionFunction -> Function[{x, y, z}, x < y],
 PlotRange -> {0, 12}, 
 MaxRecursion -> 4]

Graphic output: truncated in y

While the first graphics works as expected, the range in y has dramatically been reduced in the second one and I cannot explain why.

If I remove the RegionFunction specification, then the problem goes away (but in more advanced graphs, I need to keep this specification).

If I add PlotRange -> {All, All, {0, 12}} in the second input, then again, the problem goes away, which is an acceptable workaround, but I don't understand why it is needed.

Can somebody please explain this behaviour ? Is this a joint bug of RegionFunction, MaxRecursion and PlotRange or a desired feature that I am not understanding ?

Thanks.

I am running Mathematica 12.0.0 on MacOS 10.14.6.

$\endgroup$
  • $\begingroup$ In Mathematica v11.0.1 the plotrange doesn't change(as expected)! $\endgroup$ – Ulrich Neumann Aug 7 at 8:31

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.