Message Boards Message Boards

GROUPS:

Avoid issue while using RegionPlot?

Posted 2 months ago
370 Views
|
3 Replies
|
0 Total Likes
|

My simple code

o1 = Rectangle[{0, 0}, {3, 2}];
o2 = Disk[{3, 1}, 0.5];
o = RegionDifference[o1, o2];
RegionPlot[o, PlotRange -> Full]
DiscretizeRegion[o]

Produces this strange output. It seems to me, that the RegionPlot output is not OK, beacuse the shape of the region is different. Function DiscretizeRegion works as expected.. Screenshot

3 Replies

Try with an explicit PlotRange:

RegionPlot[
 RegionDifference[Rectangle[{0, 0}, {3, 2}], Disk[{3, 1}, 1/2]], 
 PlotRange -> {{-1, 4}, {-1, 4}}]
Posted 2 months ago

My mistake! The problem is only in the PlotRange parameter. In former version of Mathematica, teh full region was visible vithout explicit PlotRange specification, now it is necessary to specify propper PlotRange. Thanks!

To visualize it you can simply do it like so:

Region[o]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract