# plotting – Mesh Control Problem

I am having trouble combining two graphical objects. The problem has to do with controlling mesh lines. The simplest failing example is combining a circle graphics primitive with a RegionPlot. Either works separately, but when combined I get undesirable side effects.

Here is the circle. Note that its circumference is opaque black.

`````` gr1 = Graphics[
Circle[{0, 0}, 5],
ImageSize -> 200,
Axes -> False,
Ticks -> False
]
`````` Here is the RegionPlot. Note that no mesh lines appear.

``````Parametric2CartesianCenter[a_, b_, [Theta]_] :=
{a * Cos[[Theta]], b * Sin[[Theta]]};
point1 = Parametric2CartesianCenter[5, 3, 2 [Pi]/3];
point2 = Parametric2CartesianCenter[5, 3, 7 [Pi]/16];
constraintLeft = x >= point1[];
constraintRight = x <= point2[];
constraintCircle = x^2 + y^2 <= 5^2;
rp1 = RegionPlot[
constraintLeft && constraintRight && constraintCircle, {x, -5,
5}, {y, 5, -5},
ImageSize -> 200,
Axes -> False,
Ticks -> False,
Frame -> None
]
`````` Here is what happens if I try to combine them using Show in either order. Note that if the circle appears first, mesh lines are displayed, but when the order is swapped, the circle is no longer black. My goal is to have no mesh lines and a black circle.

``````s1ab = Row[{Show[gr1, rp1], Show[rp1, gr1]}]
`````` I am aware of the TransparentPolygonMesh option. It works as expected when set on the uncombined constructs.

``````rp2 = RegionPlot[
constraintLeft && constraintRight && constraintCircle, {x, -5,
5}, {y, 5, -5},
ImageSize -> 200,
Axes -> False,
Ticks -> False,
Frame -> None,
Method -> {"TransparentPolygonMesh" -> True}
];
gr2 = Graphics[
Circle[{0, 0}, 5],
ImageSize -> 200,
Axes -> False,
Ticks -> False,
Method -> {"TransparentPolygonMesh" -> False}
];
`````` However, when combining the constructs, in either order, I still see the anomalous behavior:

``````sb2 = Row[{Show[rp2, gr2], Show[gr2, rp2]}]
`````` Here are some of the other workarounds I have tried:

• In addition to Show, I have tried combining the two constructs using Overlay, Prolog, and Epilog. I have also tried placing First@RegionPlot into the the same Graphics call as the call to Circle.
• I have tried placing the TransparentPolygonMesh option independently into the calls to Graphics and RegionPlot. I have also tried setting the option in the call to Show.
• I have tried MeshFunction->{}. I have tried Mesh->None. I have tried MeshStyle->{}. I have MeshShading->{}. I have tried BoundaryStyle->None.

None of these approaches solve the problem.

I realize I could likely work around the problem either by representing the circle as a region and doing a RegionUnion or by devising a texture. However, my real problem involves an extensive series of such combinations using an existing collection of Graphics and RegionPlots that I wish to combine in various ways. It seems that there should be a way to control this behavior.

Question: How can I control the behavior of mesh lines without effecting the presentation of other graphics constructs with which it is combined?

I am using Mathematica 12.1.0.0 on a MacBook Pro, running OSX 10.13.4.