JupyterHub - Using Matplotlib


When using matplotlib inside JupyterHub, you likely to see this warning:






While annoying, it doesn't create an issue from what we've seen. But if you want to get rid of the warning, here's an easy snippet to set $MPLCONFIGDIR.

import os    
import tempfile
os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp()

import matplotlib.pyplot as plt
import numpy as np