From 47a9093f901469486fca5b83babeb26ca98fa85d Mon Sep 17 00:00:00 2001 From: blue-fish <67130644+blue-fish@users.noreply.github.com> Date: Mon, 26 Oct 2020 00:29:13 -0700 Subject: [PATCH] Matplotlib colorbar update (#573) --- encoder/inference.py | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/encoder/inference.py b/encoder/inference.py index d769dd1..4ca417b 100644 --- a/encoder/inference.py +++ b/encoder/inference.py @@ -171,7 +171,8 @@ def plot_embedding_as_heatmap(embed, ax=None, title="", shape=None, color_range= cmap = cm.get_cmap() mappable = ax.imshow(embed, cmap=cmap) cbar = plt.colorbar(mappable, ax=ax, fraction=0.046, pad=0.04) - cbar.set_clim(*color_range) + sm = cm.ScalarMappable(cmap=cmap) + sm.set_clim(*color_range) ax.set_xticks([]), ax.set_yticks([]) ax.set_title(title) diff --git a/requirements.txt b/requirements.txt index 1a2ea96..516ce40 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ tensorflow==1.15 umap-learn visdom librosa>=0.8.0 -matplotlib>=2.0.2 +matplotlib>=3.3.0 numpy>=1.14.0 scipy>=1.0.0 tqdm -- GitLab