# Creating custom schematics with mathematica

I want to produce the following schematic

A starting code

Clear["Global*"];
a1 = Graphics[{Arrowheads[0.025], Arrow[{{0, 0}, {2, 0}}]}];
a2 = Graphics[{Dashed, Line[{{0, 0}, {-2, 0}}]}];
a3 = Graphics[{Arrowheads[0.025], Arrow[{{0, 0}, {0, 2}}]}];
a4 = Graphics[{Arrowheads[0.025], Arrow[{{0, 0}, {-1.5, -1}}]}];
a5 = Graphics[{Dashed, Line[{{0, 0}, {1.5, 1}}]}];
p1 = ListPlot[{{-1.1, -0.72}},
PlotStyle -> {GrayLevel[0.4], PointSize[0.045]}];
p2 = ListPlot[{{ 1.1, 0.72}},
PlotStyle -> {GrayLevel[0.4], PointSize[0.045]}];
Show[{a1, a2, a3, a4, a5, p1, p2}, ImageSize -> 550]


I can also easily insert all the text. My problem is how to insert the twisted arrow around the z axis. Any ideas?

• Graphics Graphics3D DrawingTools?
– Kuba
Commented Sep 5, 2016 at 9:42
• I think this is too broad. Please start by learning how to build graphics from primitives, then ask specific questions about the points where you get stuck. See here for axes with arrows: mathematica.stackexchange.com/a/11606/12 mathematica.stackexchange.com/q/2785/12 Commented Sep 5, 2016 at 9:47
• The curved arrow will need to be done from scratch. Use a Table to create the set of coordinates manually, and put them in Arrow. Commented Sep 5, 2016 at 9:49
• I think broad guidelines would be in order, so you know that you are on the right track: 1. build everything from graphics primitives and put them in a Graphics3D. The axes need to be done manually too if we want arrowheads, use Arrow. Use Dashed or Dotted directives for those appearances. For lines, Line. For text, Text. Use Background -> White in Text to make it obscure the line behind like with $r_1$. Use Sphere[] for the balls, $P_1, P_2$. The curved arrow will be a single Arrow primitive. Use the Arrowheads directive to control the arrow size. Commented Sep 5, 2016 at 10:03
• " My problem is the arrows." Use Arrow instead of Line, and use the Arrowheads directive to specify their size. Instead of ListPlot, use Point and the PointSize directive. Normally one would put everything in a single Graphics instead of combining multiple ones with Show. Since this is really 3D, you can consider Graphics3D instead. Commented Sep 5, 2016 at 14:06

## 2 Answers

I've created this:

TwistArrow[pos_List, ab_List] :=
Module[{ellipse, arrow, pos1 = pos[[1]], pos2 = pos[[2]],
a = ab[[1]], b = ab[[2]]},
ellipse =
Graphics[
Rotate[Circle[pos, {a, b}, {135 Degree, 405 Degree}], 0 Degree]];
arrow = Graphics[{Arrowheads[0.015],
Arrow[{{a Cos[45 Degree] + pos1,
b Sin[45 Degree] + pos2}, {a Cos[45*Degree] + pos1 - 0.06,
b Sin[45*Degree] + pos2 + 0.035}}]}];
plot = Show[ellipse, arrow]
]


which gives (plot1 is the figure Showed in the question)

Show[plot1,TwistArrow[{0, 1}, 0.1 {2, 1}]]


pos_List={0,1} is the location of the center of the ellipse, and ab_List=0.1 {2,1} are the major and minor axis of the ellipse (or semi-axis?). The other parameters, i.e. all angles, size of the arrow (Arrowheads[0.015]) and the positioning (-0.06 and +0.035`) were chosen for this particular problem. One can put them all as arguments of the function, but I think it's easiest to just fiddle with the parameters to find the right ones.

• It works like a charm! Many thanks. Commented Sep 5, 2016 at 16:08

Have a look at SciDraw at http://scidraw.nd.edu/. Lots of support for many kinds of figures.

• Looks interesting. Commented Sep 5, 2016 at 16:18
• @DanielLichtblau It's one of the largest and most carefully designed free packages that I am aware of. The biggest strength is creating multipanel figures. Drawbacks are performance and the fact that it is quite different from standard Mathematica, so it takes a while to learn. Commented Sep 6, 2016 at 10:26