Source code for pyiem.plot.use_agg
"""A utility to load matplotlib and set the backend to AGG."""
# pylint: disable=unused-import,wrong-import-position
import os
import matplotlib
from matplotlib.figure import Figure
from pandas.plotting import register_matplotlib_converters
matplotlib.use("agg")
# Workaround a pandas dataframe to matplotlib issue
register_matplotlib_converters()
# work around warning coming from pooch
if "TEST_DATA_DIR" not in os.environ:
os.environ["TEST_DATA_DIR"] = "/tmp"
__all__ = ["figure"]