Skip to content

Commit a94b328

Browse files
authored
Merge branch 'master' into master
2 parents 4eaced7 + 822c9ca commit a94b328

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

RELEASE.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
0.3.0
22
- Add implementations of Persistence Landscapes, including plotting methods, a transformer, and additional notebooks.
33

4+
0.2.1
5+
- Allowed for more than 9 diagram labels in plot_persistence_diagrams.
6+
47
0.2.0
58
- New full featured implementation of Persistence Images.
69
- Legacy PersImage now deprecated.

persim/visuals.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,14 @@ def plot_diagrams(
6767

6868
xlabel, ylabel = "Birth", "Death"
6969

70-
if labels is None:
71-
# Provide default labels for diagrams if using self.dgm_
72-
labels = [
73-
"$H_0$",
74-
"$H_1$",
75-
"$H_2$",
76-
"$H_3$",
77-
"$H_4$",
78-
"$H_5$",
79-
"$H_6$",
80-
"$H_7$",
81-
"$H_8$",
82-
]
83-
8470
if not isinstance(diagrams, list):
8571
# Must have diagrams as a list for processing downstream
8672
diagrams = [diagrams]
8773

74+
if labels is None:
75+
# Provide default labels for diagrams if using self.dgm_
76+
labels = ["$H_{{{}}}$".format(i) for i , _ in enumerate(diagrams)]
77+
8878
if plot_only:
8979
diagrams = [diagrams[i] for i in plot_only]
9080
labels = [labels[i] for i in plot_only]
@@ -281,4 +271,4 @@ def wasserstein_matching(I1, I2, matchidx, palette=None, labels=["dgm1", "dgm2"]
281271
else:
282272
plt.plot([I1[i, 0], I2[j, 0]], [I1[i, 1], I2[j, 1]], "g")
283273

284-
plot_diagrams([I1, I2], labels=labels, ax=ax)
274+
plot_diagrams([I1, I2], labels=labels, ax=ax)

0 commit comments

Comments
 (0)