summaryrefslogtreecommitdiff
path: root/src/python/gudhi/persistence_graphical_tools.py
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-11-27 10:31:23 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-11-27 10:31:23 +0100
commit1e1cb09adf07f0351557d3bf8011c9fc3e1b4628 (patch)
tree79fe04cf83dab76c1d3fee0926f2f4405134a645 /src/python/gudhi/persistence_graphical_tools.py
parentec9c03aa2788b66350760e702020948731823148 (diff)
Fix #150 axes has no attribute colorbar
Diffstat (limited to 'src/python/gudhi/persistence_graphical_tools.py')
-rw-r--r--src/python/gudhi/persistence_graphical_tools.py5
1 files changed, 2 insertions, 3 deletions
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")