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):