From b871c5ab0acf572c4720ea17acdacccdd188e354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=BCmmmerer?= Date: Mon, 11 Nov 2024 21:08:11 +0100 Subject: [PATCH] Option to specify colormap in visualize_distribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Kümmmerer --- pysaliency/plotting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pysaliency/plotting.py b/pysaliency/plotting.py index d4e3dc5..0e129a5 100644 --- a/pysaliency/plotting.py +++ b/pysaliency/plotting.py @@ -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)