How to draw a contour diagram in Mathematica?
Here's a quick 5 minute reproduction of the diagram (I've left the labeling of individual points out):
With[{ε = 0.05, L = 1, thick = AbsoluteThickness[1]},
Graphics[{
thick,
Circle[{0, 0}, ε, {π/2, 3 π/2}],
Arrowheads[{{0.05, 0.99}}],
Arrow[{{0, -ε}, {L, -ε}, {L, -L}, {-L, -L}, {-L, L}, {L, L}, {L, ε}, {0, ε}}],
Text[Style["\!\(\*SubscriptBox[\(C\), \(n\)]\)", FontSize -> 15], {L/2, 0.1}]
}, Axes -> True, AxesStyle -> thick, Ticks -> False]
]
The key points to make life simple are:
- Use a single
Arrow
chain for the entire length. - Use the appropriate definition of
Arrowheads
to specify the position of the arrow head. - Use
AbsoluteThickness
to get a uniform thickness. - Use the 3 argument form of
Circle
to draw arcs.
Graphics[{Circle[{0, 0}, 1, Pi/2 {1, 3}],
Arrow[{{10, 1}, {0, 1}}],
Line[{{0, 1}, {10, 1}, {10, 10}, {-10, 10}, {-10, -10}, {10, -10}, {10, -1}, {0, -1}}]},
Axes -> True, Ticks -> None]