import matplotlib matplotlib.use("Agg") import numpy as np from pathlib import Path from scipy.spatial import Voronoi, voronoi_plot_2d