From c04e34d9d3d95f3e2cb39fbe15e7204244b9b2a0 Mon Sep 17 00:00:00 2001
From: Chris Havlin <chris.havlin@gmail.com>
Date: Mon, 16 Dec 2024 16:42:53 -0600
Subject: [PATCH] Backport PR #5083: BUG: fix compatibility with matplotlib
 3.10 for images that have both a custom background color and a
 non-transparent 'bad' color

---
 yt/visualization/base_plot_types.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/yt/visualization/base_plot_types.py b/yt/visualization/base_plot_types.py
index 78a1dd54591..f570fadbcf9 100644
--- a/yt/visualization/base_plot_types.py
+++ b/yt/visualization/base_plot_types.py
@@ -326,6 +326,7 @@ def _init_image(self, data, extent, aspect, *, alpha: AlphaT = None):
             aspect=aspect,
             cmap=self.colorbar_handler.cmap,
             interpolation="nearest",
+            interpolation_stage="data",
             transform=transform,
             alpha=alpha,
         )