From 1e1cb09adf07f0351557d3bf8011c9fc3e1b4628 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 27 Nov 2019 10:31:23 +0100 Subject: Fix #150 axes has no attribute colorbar --- src/python/gudhi/persistence_graphical_tools.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/python/gudhi/persistence_graphical_tools.py') diff --git a/src/python/gudhi/persistence_graphical_tools.py b/src/python/gudhi/persistence_graphical_tools.py index c9dab323..7d232c85 100644 --- a/src/python/gudhi/persistence_graphical_tools.py +++ b/src/python/gudhi/persistence_graphical_tools.py @@ -369,7 +369,6 @@ def plot_persistence_density( persistence_dim = read_persistence_intervals_in_dimension( persistence_file=persistence_file, only_this_dim=dimension ) - print(persistence_dim) else: print("file " + persistence_file + " not found.") return None @@ -417,10 +416,10 @@ def plot_persistence_density( zi = k(np.vstack([xi.flatten(), yi.flatten()])) # Make the plot - axes.pcolormesh(xi, yi, zi.reshape(xi.shape), cmap=cmap) + img = axes.pcolormesh(xi, yi, zi.reshape(xi.shape), cmap=cmap) if legend: - axes.colorbar() + plt.colorbar(img, ax=axes) axes.set_xlabel("Birth") axes.set_ylabel("Death") -- cgit v1.2.3