Skip to content

Commit

Permalink
consistent use of 'n'
Browse files Browse the repository at this point in the history
  • Loading branch information
hageldave committed Sep 13, 2024
1 parent 1357714 commit e73672c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions uadapy/plotting/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
import matplotlib.pyplot as plt

def generate_random_colors(length):
return ["#"+''.join([np.random.choice('0123456789ABCDEF') for j in range(6)]) for _ in range(length)]
def generate_random_colors(n):
return ["#" +''.join([np.random.choice('0123456789ABCDEF') for j in range(6)]) for _ in range(n)]

def generate_spectrum_colors(length):
cmap = plt.cm.get_cmap('viridis', length) # You can choose different colormaps like 'jet', 'hsv', 'rainbow', etc.
return np.array([cmap(i) for i in range(length)])
def generate_spectrum_colors(n):
cmap = plt.cm.get_cmap('viridis', n) # You can choose different colormaps like 'jet', 'hsv', 'rainbow', etc.
return np.array([cmap(i) for i in range(n)])

0 comments on commit e73672c

Please sign in to comment.