summaryrefslogtreecommitdiff
path: root/src/python/gudhi/persistence_graphical_tools.py
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2023-01-20 13:47:30 +0100
committerGard Spreemann <gspr@nonempty.org>2023-01-20 13:47:30 +0100
commit688cbc5c29d0a6aaf233eee185a06cef5cb2e745 (patch)
treecb13b84e9f7cddea48b903d24014f63d1dfda7e3 /src/python/gudhi/persistence_graphical_tools.py
parent2b3caf86fc6500a9fca9e9085012a2315fbbac3b (diff)
parented492f09ca3c9d7cd972bbbbec37f680cd624fbe (diff)
Merge tag 'tags/gudhi-release-3.7.1' into dfsg/latestdfsg/latest
Diffstat (limited to 'src/python/gudhi/persistence_graphical_tools.py')
-rw-r--r--src/python/gudhi/persistence_graphical_tools.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/python/gudhi/persistence_graphical_tools.py b/src/python/gudhi/persistence_graphical_tools.py
index 21275cdd..e438aa66 100644
--- a/src/python/gudhi/persistence_graphical_tools.py
+++ b/src/python/gudhi/persistence_graphical_tools.py
@@ -194,19 +194,21 @@ def plot_persistence_barcode(
y=[(death - birth) if death != float("inf") else (infinity - birth) for (dim,(birth,death)) in persistence]
c=[colormap[dim] for (dim,(birth,death)) in persistence]
- axes.barh(list(reversed(range(len(x)))), y, height=0.8, left=x, alpha=alpha, color=c, linewidth=0)
+ axes.barh(range(len(x)), y, left=x, alpha=alpha, color=c, linewidth=0)
if legend:
- dimensions = list(set(item[0] for item in persistence))
+ dimensions = set(item[0] for item in persistence)
axes.legend(
handles=[mpatches.Patch(color=colormap[dim], label=str(dim)) for dim in dimensions], loc="lower right",
)
axes.set_title("Persistence barcode", fontsize=fontsize)
+ axes.set_yticks([])
+ axes.invert_yaxis()
# Ends plot on infinity value and starts a little bit before min_birth
if len(x) != 0:
- axes.axis([axis_start, infinity, 0, len(x)])
+ axes.set_xlim((axis_start, infinity))
return axes
except ImportError as import_error: