Vector Graphics Plots using Matplotlib in Jupyter

Here’s a neat trick I learned today to display all matplotlib plots as vector format rather than raster in Jupyter notebooks:

%matplotlib inline
# produce vector inline graphics
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf', 'svg')
import matplotlib.pyplot as plt