From c628930c149ea7f291f653b5ad386f26a0ec7d0c Mon Sep 17 00:00:00 2001 From: Moka-4444 <159596295+Moka-4444@users.noreply.github.com> Date: Mon, 23 Mar 2026 17:10:44 +0200 Subject: [PATCH] Fix #93: Correct key check for custom edge_cmap in nx_draw_with_pos_and_attr Changed the key check from 'cmap' to 'edge_cmap' to prevent silently overwriting the user-provided edge_cmap. --- src/weather_model_graphs/visualise/plot_2d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/weather_model_graphs/visualise/plot_2d.py b/src/weather_model_graphs/visualise/plot_2d.py index 9cf28ed..e4f3ec4 100644 --- a/src/weather_model_graphs/visualise/plot_2d.py +++ b/src/weather_model_graphs/visualise/plot_2d.py @@ -146,7 +146,7 @@ def nx_draw_with_pos_and_attr( graph, edge_color_attr, component="edges" ) - if "cmap" not in kwargs: + if "edge_cmap" not in kwargs: if "discrete_labels" in edge_attr_vals: kwargs["edge_cmap"] = plt.get_cmap("tab20") else: