# Zoom into RegionPlot of a region made with RegionDifference/RegionUnion

I have a region defined like in this question:

circle = Disk[{4.5, 3}, 0.5];
pin = Rectangle[{4, 0}, {5, 3}];
square = Rectangle[{0, 0}, {9, 9}];
region = RegionDifference[square, RegionUnion[circle, pin]];


RegionPlot[region] gives: Now I want to zoom into a semicircular opening. I attempt it like this:

RegionPlot[region,{x,3,6},{y,2,6}]

This doesn't work and gives an error:

RegionDifference[Rectangle[{0,0},{9,9}],RegionUnion[Disk[{4.5,3},0.5],\ Rectangle[{4,0},{5,3}]]] should be a Boolean combination of \ equations, inequalities, and Element statements

What do I do to solve this?

## 2 Answers

RegionPlot appears to be built with implicit regions in mind. To make it work you could use Element:

RegionPlot[Element[{x, y}, region], {x, 3, 6}, {y, 2, 6}] But for zooming in, PlotRange also comes to mind. This requires no trickery:

RegionPlot[region, PlotRange -> {{3, 6}, {2, 6}}] You can intersect your region with a rectangle representing the zoom-in area.

zoomInRect = Rectangle[{3, 2}, {6, 6}];
zoomInView = RegionIntersection[region, zoomInRect];
RegionPlot[zoomInView] 