3
$\begingroup$

I have the following code below, which allows me to plot two nice figures in the plane.

z = a + I*b;
f[z_] = 1 + z + z^2/2 + z^3/6 + z^4/24 ;
g[z_] = z + 1;
ParametricPlot[{a, b}, {a, -3, 1}, {b, -3, 3}, 
 RegionFunction -> Function[{a, b}, Abs[f[z]] < 1], MaxRecursion -> 4]
ParametricPlot[{a, b}, {a, -3, 1}, {b, -3, 3}, 
 RegionFunction -> Function[{a, b}, Abs[g[z]] < 1], MaxRecursion -> 6]

images

In order to put them together, I came up with the following.

z = a + I*b;
f[z_] = 1 + z + z^2/2 + z^3/6 + z^4/24 ;
g[z_] = z + 1;
ParametricPlot[{ConditionalExpression[{a, b}, Abs[f[z]] < 1], 
  ConditionalExpression[{a, b}, Abs[g[z]] < 1]}, {a, -3, 1}, {b, -3, 3}]

image

Now I got this terrible figure. Even setting MaxRecursion to it's maximum won't make difference. How can I solve this problem?

Thanks.

$\endgroup$
  • 1
    $\begingroup$ Why not use RegionFunction again? Function[{a, b}, Abs[f[z]] < 1 || Abs[g[z]] < 1]? (Use && if you want the intersection instead of the union.) $\endgroup$ – J. M. is away Jun 24 '15 at 2:53
  • $\begingroup$ You mean inside or outside the conditional expression? Outside I'm not sure I want and inside I'm not sure how it works. $\endgroup$ – Integral Jun 24 '15 at 2:54
  • $\begingroup$ Hmmmm... I think I got what you mean, let me give a try. $\endgroup$ – Integral Jun 24 '15 at 2:56
  • 2
    $\begingroup$ Ah, if you want the two regions to be distinct, then just put them in separate ParametricPlot[]s and use Show[] to combine them. $\endgroup$ – J. M. is away Jun 24 '15 at 3:01
  • 1
    $\begingroup$ Then, can you please write an answer to your own question? $\endgroup$ – J. M. is away Jun 24 '15 at 3:17
5
$\begingroup$

The code below solved my problem.

z = a + I*b;
f[z_] = 1 + z + z^2/2 + z^3/6 + z^4/24 ;
g[z_] = z + 1;
P1 := ParametricPlot[{a, b}, {a, -3, 1}, {b, -3, 3}, 
   RegionFunction -> Function[{a, b}, Abs[f[z]] < 1], 
   MaxRecursion -> 4];
P2 := ParametricPlot[{a, b}, {a, -3, 1}, {b, -3, 3}, 
   RegionFunction -> Function[{a, b}, Abs[g[z]] < 1], 
   MaxRecursion -> 4];
Show[P1, P2]

I got the following figure.

image

I was thinking about two different colors, but this two kinds of blue are just fine. Of course changing the colors are not a problem now, if I want to change. Thank you for the help, Guess who it is.

$\endgroup$
4
$\begingroup$

I have upvoted the self answer. Just to illustrate another approach:

f[z_] := 1 + z + z^2/2 + z^3/6 + z^4/24;
g[z_] := z + 1
RegionPlot[{Abs[f[x + I y]] < 1, Abs[g[x + I y]] < 1}, {x, -3, 
  1}, {y, -3, 3}, PlotStyle -> {Red, Blue}, AspectRatio -> Automatic]

enter image description here

$\endgroup$

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.