Skip to content

Commit

Permalink
fix: update matplotlib cmap for deprecation (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose authored Feb 3, 2025
1 parent 27a8767 commit 8d7e9f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions LoopStructural/utils/colours.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand All @@ -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):
Expand Down

0 comments on commit 8d7e9f9

Please sign in to comment.