1
$\begingroup$

On the complex plane, I want to plot the set of points defined by the solution of a system of equality and inequalites, such as $S=\{z \in \mathbb{C}| Im[z+1]=0 \cap Re[z+1]>0 \}$. However, ContourPlot does not accept inequalities. Also, RegionPlot do not accept equalities.

Any hints?

Here's a MWE that do NOT work

ContourPlot[Im[Z + 1 /. {Z -> x + I y}] == 0 && Re[Z + 1 /. {Z -> x + I y}] > 0, {x, -2, 2}, {y, -2, 2}]
$\endgroup$

1 Answer 1

1
$\begingroup$

Maybe:

ContourPlot[Im[x + I y + 1] == 0, {x, -2, 2}, {y, -2, 2},
 RegionFunction -> Function[{x, y}, Re[x + I y] > 0]]

is what you look for?

$\endgroup$
3
  • $\begingroup$ Except for the wrong inequality, it works. I guess that as a general rule, one should put in ContourPlot the equality and in RegionFunction the solution of the inequalities, something like myFun[Z_] := Z; ContourPlot[Im[myFun[Z] /. {Z -> x + I y}] == 0, {x,-1,1}, {y,-1,1}, RegionFunction -> Function[{x, y}, Re[myFun[Z] /. {Z -> x + I y}] > 0]] $\endgroup$
    – Nicola
    Oct 27, 2014 at 6:27
  • $\begingroup$ Ahh, I missed a 1. I don't know why you are replacing as you do. Why not do myFun[x+I y] directly? $\endgroup$
    – mickep
    Oct 27, 2014 at 6:32
  • $\begingroup$ It depends on your application I guess. $\endgroup$
    – Nicola
    Oct 27, 2014 at 7:36

Your Answer

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

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