From 60d84311724af6d0132e5d61481dc2ea98b2272b Mon Sep 17 00:00:00 2001 From: Frankie Lucco Date: Tue, 28 Oct 2025 21:40:10 -0500 Subject: [PATCH] Fix visualization error for PropertyLayers on HexGrids. Add tranpose operation before ravel operation. --- mesa/visualization/backends/matplotlib_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesa/visualization/backends/matplotlib_backend.py b/mesa/visualization/backends/matplotlib_backend.py index aea3e74ccc2..96b4d901364 100644 --- a/mesa/visualization/backends/matplotlib_backend.py +++ b/mesa/visualization/backends/matplotlib_backend.py @@ -391,7 +391,7 @@ def draw_propertylayer(self, space, property_layers, propertylayer_portrayal): elif isinstance(space, HexGrid): hexagons = self.space_drawer.hexagons norm = Normalize(vmin=vmin, vmax=vmax) - colors = data.ravel() + colors = data.T.ravel() if color: normalized_colors = np.clip(norm(colors), 0, 1)