5
$\begingroup$

Bug introduced in version 13.0

I'm very new to mathematica and I've just begun plotting colorplots for Complex functions. Currently, I'm trying to set the output to be only restricted to the unit disk (|z|<1) and I stumbled upon RegionFunction. However it seems, the following sample code under RegionPlot from Mathematica:

Table[ComplexPlot[Exp[-z] Sin[3 z], {z, -2 - 2 I, 2 + 2 I}, 
  PlotPoints -> 50, MaxRecursion -> mr, 
  RegionFunction -> Function[z, Abs[z] <= 0.5]], {mr, 0, 2}]

does not seem to work. Am I forgetting something or does RegionFunction not apply for Complex Functions?

$\endgroup$
4
  • $\begingroup$ It works for me on V 13.0.1 screen shot !Mathematica graphics unless you mean something else by does not seem to work $\endgroup$
    – Nasser
    May 15, 2022 at 8:00
  • $\begingroup$ On v12.2.0, Win7-x64, I run ComplexPlot[Exp[-z] Sin[3 z], {z, -2 - 2 I, 2 + 2 I}, PlotPoints -> 50, MaxRecursion -> 4, RegionFunction -> Function[z, Abs[z] <= 1]] to get this output. $\endgroup$
    – Syed
    May 15, 2022 at 8:33
  • 2
    $\begingroup$ It must be a bug. The RegionFunction in ComplexPlot does not work in 13.0.1. $\endgroup$
    – cvgmt
    May 15, 2022 at 9:40
  • $\begingroup$ The bug appears to have been introduced in v13.0 $\endgroup$
    – Bob Hanlon
    May 15, 2022 at 13:08

1 Answer 1

5
$\begingroup$

It must be a bug. Here is a working around.

ComplexPlot[Exp[-z] Sin[3 z], {z, -2 - 2 I, 2 + 2 I}, 
 PlotPoints -> 50, MaxRecursion -> 2, 
 MeshFunctions -> Function[{z}, Abs[z]], Mesh -> {{.5}}, 
 MeshShading -> {Automatic, None}]

enter image description here

Another example in document also can not work in 13.0.1 and here we still using Mesh.

ComplexPlot[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I}, 
 RegionFunction -> Function[{z, f}, 1 <= Abs[f] <= 2]]
ComplexPlot[(z^2 + 1)/(z^2 - 1), {z, -2 - 2 I, 2 + 2 I}, 
 PlotPoints -> 80, MaxRecursion -> 4, 
 MeshFunctions -> Function[{z, f}, Abs[f]], Mesh -> {{1, 2}}, 
 MeshShading -> {None, Automatic}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Hi! Thanks for the answer. It seems it is a bug indeed but this workaround does the job! $\endgroup$
    – deedeefive
    May 15, 2022 at 19:44

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.