I am using the function ImplicitRegion[].

RegionPlot[ImplicitRegion[x^2 + y^2 == -1, {x, y}]]

enter image description here

which gives me a circle, though in the documentation variables are said to be real.

Adding additional assumption does not change anything:

RegionPlot[ Assuming[{x, y} \[Element] Reals, 
  ImplicitRegion[   x^2 + y^2 == -1, {{x, -\[Pi], \[Pi]}, {y, -\[Pi], \[Pi]}}]]]

How to fix this issue?


If ImplicitRegion was working properly you would not get a plot. If you are trying to plot the equation:

funcs = y /. Solve[x^2 + y^2 == -1, y];

ReImPlot[funcs, {x, -Pi, Pi},
 PlotStyle -> {AbsoluteThickness[3], Automatic},
 PlotLegends -> Automatic]

enter image description here

  • $\begingroup$ But is there a way to tell ImplicitRegion that (x,y) are real and thus there are no solutions? I am using this function in NIntegrate so it's important not to get fake contours. $\endgroup$ Apr 8 '21 at 6:07
  • $\begingroup$ ImplicitRegion does not take an Assumptions option so you have to explicitly include the domain constraint. RegionPlot[ImplicitRegion[x^2 + y^2 == -1 && Element[{x, y}, Reals], {x, y}], {x, -Pi, Pi}, {y, -Pi, Pi}] will return an empty plot. $\endgroup$
    – Bob Hanlon
    Apr 8 '21 at 6:15
  • $\begingroup$ I tried changing -1 to 1 in your example and it gave an empty plot again. $\endgroup$ Apr 8 '21 at 7:57
  • 1
    $\begingroup$ Yes; however, you indicated that your actual problem is integration. Both Integrate[1, {x, y} \[Element] ImplicitRegion[x^2 + y^2 == 1, {x, y}]] and Integrate[1, {x, y} \[Element] ImplicitRegion[x^2 + y^2 == -1, {x, y}]] return the expected results. As do Integrate[1, {x, y} \[Element] ImplicitRegion[x^2 + y^2 == 1 && Element[{x, y}, Reals], {x, y}]] and Integrate[1, {x, y} \[Element] ImplicitRegion[x^2 + y^2 == -1 && Element[{x, y}, Reals], {x, y}]] $\endgroup$
    – Bob Hanlon
    Apr 8 '21 at 13:00
  • $\begingroup$ oh, I see, thanks! Perhaps the problem is related to RegionPlot. $\endgroup$ Apr 8 '21 at 15:43

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.