2
$\begingroup$

I'm trying a 2d plot using the following code:

> Zs[z_] := 2 * (1 - CDF[NormalDistribution[0, 1], Abs[z]])

> RegionPlot[{Zs[x] <= 0.1 + (1 - 0.1)*Zs[y] && Zs[y] - Zs[x] <= 0,  
  Zs[y] <= 0.1 + (1 - 0.1)*Zs[x] && Zs[x] - Zs[y] <= 0}, {x, -5, 
  5}, {y, -5, 5}, PlotStyle -> Blue, 
 FrameLabel -> {"\!\(\*SubscriptBox[\(p\), \(1\)]\)", 
 "\!\(\*SubscriptBox[\(p\), \(2\)]\)"}, BoundaryStyle -> None]

I imagine the plot before Enter, it should be a quadratic symmetric region, however, the result is the following region: enter image description here

You can see the blue region on second and fourth quadrant have some difference with the region in the 1st and 3rd quadrant. I can't understand why this happen.

$\endgroup$
3
  • $\begingroup$ Including PlotPoints -> 100 helps. $\endgroup$
    – JimB
    Aug 19, 2022 at 4:41
  • $\begingroup$ Thanks so much! It relieves this problem. $\endgroup$
    – 0o0o0o0
    Aug 19, 2022 at 4:42
  • $\begingroup$ PlotPoints->100 still missing some parts. $\endgroup$
    – cvgmt
    Aug 19, 2022 at 7:36

1 Answer 1

1
$\begingroup$

It is recommend to do this by two steps and use ContourPlot and Contours->{0}.

Zs[z_] = 2*(1 - CDF[NormalDistribution[0, 1], Abs[z]]);
plot1 = ContourPlot[
   Zs[x] - (0.1 + (1 - 0.1)*Zs[y]), {x, -5, 5}, {y, -5, 5}, 
   Contours -> {0}, 
   RegionFunction -> Function[{x, y}, Zs[y] - Zs[x] <= 0 ], 
   PlotPoints -> 60, ContourShading -> {Blue, None}];
plot2 = ContourPlot[
   Zs[y] - (0.1 + (1 - 0.1)*Zs[x]), {x, -5, 5}, {y, -5, 5}, 
   Contours -> {0}, 
   RegionFunction -> Function[{x, y}, Zs[x] - Zs[y] <= 0 ], 
   PlotPoints -> 60, ContourShading -> {Blue, None}];
Show[plot1, plot2]

enter image description here

$\endgroup$

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