Skip to content

Commit

Permalink
Option to specify colormap in visualize_distribution
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kümmmerer <[email protected]>
  • Loading branch information
matthias-k committed Nov 11, 2024
1 parent 7313880 commit 800bb5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pysaliency/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ def normalize_log_density(log_density):
unsorted_cummulative = cummulative[np.argsort(inds)]
return unsorted_cummulative.reshape(log_density.shape)

def visualize_distribution(log_densities, ax=None, levels=None, level_colors='black'):
def visualize_distribution(log_densities, ax=None, levels=None, level_colors='black', cmap=plt.cm.viridis):
if ax is None:
ax = plt.gca()
t = normalize_log_density(log_densities)
img = ax.imshow(t, cmap=plt.cm.viridis)
img = ax.imshow(t, cmap=cmap)
if levels is None:
levels = [0, 0.25, 0.5, 0.75, 1.0]
cs = ax.contour(t, levels=levels, colors=level_colors)
Expand Down

0 comments on commit 800bb5b

Please sign in to comment.