use agg for rendering by default

This commit is contained in:
Jan Petykiewicz 2026-11-25 17:29:35 -08:00
commit 66934cfdc3

View file

@ -1,6 +1,16 @@
from __future__ import annotations
import os
from typing import TYPE_CHECKING, cast
import matplotlib
# The example/diagnostic plotting helpers save figures to disk and do not need
# an interactive GUI backend. Default to Agg unless the caller explicitly chose
# a backend, so examples run reliably in headless or partially configured
# environments.
if "MPLBACKEND" not in os.environ:
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy
from shapely.geometry import MultiPolygon, Polygon