From 6a3fcdcddc04ce89b46684442c5c1893e673ffd6 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Mon, 3 Feb 2025 10:21:18 +1100 Subject: [PATCH] fix: update matplotlib cmap for deprecation --- LoopStructural/utils/colours.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LoopStructural/utils/colours.py b/LoopStructural/utils/colours.py index 2ed39150..ef1c7914 100644 --- a/LoopStructural/utils/colours.py +++ b/LoopStructural/utils/colours.py @@ -17,8 +17,7 @@ def random_colour(n: int = 1, cmap='tab20'): list List of colours in the form of (r,g,b,a) tuples """ - import matplotlib.cm as cm - + from matplotlib import colormaps as cm colours = [] for _i in range(n): colours.append(cm.get_cmap(cmap)(rng.random())) @@ -41,7 +40,7 @@ def random_hex_colour(n: int = 1, cmap='tab20'): list List of colours in the form of hex strings """ - import matplotlib.cm as cm + from matplotlib import colormaps as cm colours = [] for _i in range(n):