
INSTALL MATPLOTLIB CONDA HOW TO
My remote HPC probably doesn’t have Microsoft fonts installed.Īs Arianna said (slacked, really) when I asked for her comments on this blog post: “This is because unlike an OS that we’re used to working with that’s all set up out-of-the-box, HPC admins don’t really have a need to use anything but some kind of Courier New.”Īnd so, I present to you… How to specify fonts in matplotlib when you are working on a Linux system:įirst off, I highly recommend using conda environments to manage research computational environments– it can enhance reproducibility and avoid package conflicts ( more here). I did this for… several years.Īnd then yesterday, I had an epiphany. I figured I was simply doing something wrong and eventually gave up on trying to fix it and just succumbed to my fate of manually changing fonts post-plotting in Adobe Illustrator. Plt.rcParams = "sans-serif"Īnd also when I modified my matplotlibrc file (more on that later). This happened both when I directly specified the font in my notebook: import matplotlib.pyplot as plt I constantly got some variation of findfont: Font family not found. However, I could not get any of my font specifications to work in matplotlib (or any dependent programs) in my notebooks that I was running via ssh tunnel. This workflow is very convenient for many reasons (keeping all files in one location, more extensibility and power for my notebooks that my personal laptop can’t handle, minimizing file storage on my local machine, etc. Over the last few years I have made a transition in my workflow from doing most of my data exploration and plotting on my local machine (a 2016 MacBook laptop) to doing most of my plotting on a remote HPC (check out this other blog post for more on that).
