0
$\begingroup$

I am not sure I understand this one, thought to check with the experts. Please compare

ClearAll[x, y]
RegionPlot[0.5 <= x^2 + y^2 <= 0.75, {x, -2.5, 2}, {y, -2, 2}, 
        Axes -> True, AspectRatio -> Automatic]

Mathematica graphics

with

ClearAll[x, y]
RegionPlot[0.5 <= x^2 + y^2 <= 0.75, {x, -3, 2}, {y, -2, 2}, 
      Axes -> True, AspectRatio -> Automatic]

Mathematica graphics

Where the x range was just increased a little in the second case. I did not think this should affect the output. What Am I missing?

Mathematica graphics

$\endgroup$
1
$\begingroup$
RegionPlot[0.5 <= x^2 + y^2 <= 0.75, {x, -3, 2}, {y, -2, 2},
 PlotPoints -> 50, Axes -> True, AspectRatio -> Automatic]
$\endgroup$
  • $\begingroup$ thanks. I would never have guessed it is the plot points. But this is not really a good way for RegionPlot to handle these things. How is the user supposed to know if the result is due to low number of sampling points internally or if the result is actually the region they should get? $\endgroup$ – Nasser Jan 28 '15 at 17:28
  • 1
    $\begingroup$ Well, PlotPoints rears its head frequently, especially in complicated functions in Plot3D. Mathematica uses PlotPoints -> Automatic as a default (of course), where the internal number is computed based on some measure of the detail in the function itself. I too am a bit surprised that for such a simple annular region Mathematica didn't figure out the needed resolution or number of points. A good rule of thumb is to check on important figures by setting PlotPoints high, and if you don't get new graphical information, revert to Automatic. $\endgroup$ – David G. Stork Jan 28 '15 at 17:34
  • $\begingroup$ Be aware, though, that there might be more severe issues with RegionPlot: TransformedRegion $\endgroup$ – Jinxed Jan 28 '15 at 18:31

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.