use agg for rendering by default
This commit is contained in:
parent
78da3f4f12
commit
66934cfdc3
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue