Posts tagged matplotlib

Load and plot a remote font with Matplotlib

As part of my sphinx-social-previews prototype, I wanted to be able to use the Roboto Font from Google in image previews. However, Roboto is often not loaded on your local filesystem, so it took some digging to figure out how to make it possible to load via Matplotlib’s text plotting functionality.

Here’s the solution that finally worked for me, inspired from this Tweet with a similar implementation from the dmol book.

../../../_images/868fcd11b95a614186ca3a676d028d4548af86c0749233733e16ac5cf97f2fed.png

Read more ...