Posts by Category

Latex

Pretty matplotlib pgf figures in Latex documents

4 minute read

Published:

In my experience adding matplotlib figures into Latex documents is not trivial at all, unless you are satisfied with a simple non-vector png. I will try to explain here how to export a figure into pgf, and how to include that in your tex file later. The usual disclamer is valid here: it works on my machine and I can’t guarantee that it will work on yours. As of now, I am using python 3.9 and matplotlib 3.4. After the tutorial you can expect some result as the one shown in the figure below. Read more

plots

Animated 3D plot in spherical coordinates with gnuplot

4 minute read

Published:

I am working on a physics experiment that involves muons that are stored in a magnetic field and are traveling along circular orbits. Their motion inside the magnetic field is quite complex and involves oscillations with different periods – essentially they are like a spinning top, but instead of precessing around only one axis, they can precess around three. Read more