3
$\begingroup$

This question is related to RegionPlot not plotting some regions.

I have the following region and want to plot the area and the boundary. In Mathematica 10.3.1 it works fine but not in 10.4.

reg = RegionDifference[Disk[{2, 0}, 2, {0, \[Pi]}],Disk[{1, 0}, 1, {0, \[Pi]}]];
{RegionPlot[reg, AspectRatio -> 1/2, ImageSize -> 250], 
 RegionPlot[RegionBoundary@reg, AspectRatio -> 1/2, ImageSize -> 250]}

enter image description here

How can one get rid of this behavior?

$\endgroup$
6
$\begingroup$

The documentation indicates the following:

RegionPlot cannot find regions that are just lines or points.

Here is a solution that comes to mind:

{RegionPlot[reg, AspectRatio -> 1/2, ImageSize -> 250], 
 RegionPlot[reg, AspectRatio -> 1/2, ImageSize -> 250, 
  BoundaryStyle -> Darker, PlotStyle -> White]}

enter image description here

This also works in the reference question.

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

enter image description here

{RegionPlot[Circle[{0, 0}, 1]], 
 RegionPlot[ImplicitRegion[x^2 + y^2 <= 1, {x, y}], BoundaryStyle -> Darker, PlotStyle -> White]}

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy