# How can I make a certain 2D plot?

I want to draw this elementary graph, shown below.

The exact path of the blue line is not important. I want to keep the blue dots to the left of the line and keep the red dots to the right of it.

I have tried the following code, but it failes to properly curve the straight line to keep all the blue dots to the left.

k = 3;
poles1 = Table[{i, 0}, {i, 0, k}];
poles2 = Table[{1/2 - n, 0}, {n, 0, k}];
Show[
Plot[100 Sign[x + 1/4], {x, -k, k},
ExclusionsStyle -> Blue,
PlotRange -> {-3, 3},
AxesStyle -> Directive[Blue, 13]],
Graphics[{PointSize[0.02], Red, Point[poles1]}],
Graphics[{PointSize[0.02], Blue, Point[poles2]}]]


Any help will be highly appreciated.

• Is this a one-off? Then do it by hand in a graphics program. You’ll be done in no time. If you want to be able to do it programmatically for variable input, then you need to tell us more about the form of the input and the line. Commented Jan 29, 2021 at 13:34
• "The exact path of the blue line is not important" - Would With[{k = 3}, poles1 = Table[{i, 0}, {i, 0, k}]; poles2 = Table[{1/2 - n, 0}, {n, 0, k}]; Graphics[{{PointSize[0.02], Red, Point[poles1]}, {PointSize[0.02], Blue, Point[poles2]}, {Blue, HalfLine[{-1/4, 0}, {0, -1}], Circle[{0, 0}, 1/4, {0, π}], Circle[{1/2, 0}, 1/4, {π, 2 π}], Circle[{0, 0}, 3/4, {0, π/2}], Circle[{0, 1}, 1/4, {-π/2, -π}], HalfLine[{-1/4, 1}, {0, 1}]}}, Axes -> True, PlotRange -> 3]] suit your needs? Commented Jan 29, 2021 at 13:40
• @J.M. This is also perfect. Thanks a lot for giving your time. Commented Jan 29, 2021 at 14:08

Why not the new-in-12.2 Canvas?:

k = 3;
poles1 = Table[{i, 0}, {i, 0, k}];
poles2 = Table[{1/2 - n, 0}, {n, 0, k}];
Show[Graphics[{PointSize[0.02], Red, Point[poles1]}],
Graphics[{PointSize[0.02], Blue, Point[poles2]}], Axes -> True, PlotRange -> 3,
AxesStyle -> Directive[Blue, 13]] // Canvas


• You deserve a huge thanks! Commented Jan 29, 2021 at 14:04

This is the answer given by J.M.in a comment to the question. It deserves to be recorded as a proper answer, so I'm posting it as a community wiki.

With[{k = 3},
poles1 = Table[{i, 0}, {i, 0, k}];
poles2 = Table[{1/2 - n, 0}, {n, 0, k}]];

Graphics[
{{PointSize[0.02],
{Red, Point[poles1]}, {Blue, Point[poles2]}},
{Blue,
HalfLine[{-1/4, 0}, {0, -1}],
Circle[{0, 0}, 1/4, {0, π}], Circle[{1/2, 0}, 1/4, {π, 2 π}],
Circle[{0, 0}, 3/4, {0, π/2}], Circle[{0, 1}, 1/4, {-π/2, -π}],
HalfLine[{-1/4, 1}, {0, 1}]}},
Axes -> True,
PlotRange -> 3]