From a2a5f1725b172e71b7d0f4e7667bdfd8fa2436c8 Mon Sep 17 00:00:00 2001 From: RicYaben Date: Mon, 3 Feb 2025 13:03:27 +0100 Subject: [PATCH 1/4] fixes issue with matplotlib=3.10 handles reversed list generator --- upsetplot/plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upsetplot/plotting.py b/upsetplot/plotting.py index c69636b..2eab4df 100644 --- a/upsetplot/plotting.py +++ b/upsetplot/plotting.py @@ -532,7 +532,7 @@ def _plot_stacked_bars(self, ax, by, sum_over, colors, title): handles, labels = ax.get_legend_handles_labels() if self._horizontal: # Make legend order match visual stack order - ax.legend(reversed(handles), reversed(labels)) + ax.legend(list(reversed(handles)), list(reversed(labels))) else: ax.legend() From bceb91d7655dd30a189eb58823c9b301a174f35b Mon Sep 17 00:00:00 2001 From: RicYaben Date: Mon, 3 Feb 2025 13:55:09 +0100 Subject: [PATCH 2/4] get rid of most annorying warning messages --- upsetplot/plotting.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/upsetplot/plotting.py b/upsetplot/plotting.py index 2eab4df..a95539e 100644 --- a/upsetplot/plotting.py +++ b/upsetplot/plotting.py @@ -792,10 +792,14 @@ def plot_matrix(self, ax): } ) ) - styles["linewidth"].fillna(1, inplace=True) - styles["facecolor"].fillna(self._facecolor, inplace=True) - styles["edgecolor"].fillna(styles["facecolor"], inplace=True) - styles["linestyle"].fillna("solid", inplace=True) + styles.fillna({ + "linewidth": 1, + "facecolor": self._facecolor, + "edgecolor": styles["facecolor"], + "linestyle": "solid" + }, + inplace=True + ) del styles["hatch"] # not supported in matrix (currently) x = np.repeat(np.arange(len(data)), n_cats) From 08f0648368122303075cbb2835ae7fea0f7f07df Mon Sep 17 00:00:00 2001 From: Romain Durand Date: Wed, 14 Jan 2026 14:46:53 -0500 Subject: [PATCH 3/4] fix #301 --- upsetplot/plotting.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/upsetplot/plotting.py b/upsetplot/plotting.py index a95539e..5f9dea9 100644 --- a/upsetplot/plotting.py +++ b/upsetplot/plotting.py @@ -909,8 +909,8 @@ def make_args(val): for rect in rects: width = rect.get_width() + rect.get_x() ax.text( - width + margin, - rect.get_y() + rect.get_height() * 0.5, + float(np.ravel(width + margin)[0]), + float(np.ravel(rect.get_y() + rect.get_height() * 0.5)[0]), fmt.format(*make_args(width)), ha="left", va="center", @@ -920,8 +920,8 @@ def make_args(val): for rect in rects: width = rect.get_width() + rect.get_x() ax.text( - width + margin, - rect.get_y() + rect.get_height() * 0.5, + float(np.ravel(width + margin)[0]), + float(np.ravel(rect.get_y() + rect.get_height() * 0.5)[0]), fmt.format(*make_args(width)), ha="right", va="center", @@ -931,8 +931,8 @@ def make_args(val): for rect in rects: height = rect.get_height() + rect.get_y() ax.text( - rect.get_x() + rect.get_width() * 0.5, - height + margin, + float(np.ravel(height + margin)[0]), + float(np.ravel(rect.get_x() + rect.get_width() * 0.5)[0]), fmt.format(*make_args(height)), ha="center", va="bottom", From 7fa2661b7989e733bfce8a668f864084b8390afd Mon Sep 17 00:00:00 2001 From: Romain Durand Date: Mon, 19 Jan 2026 14:31:29 -0500 Subject: [PATCH 4/4] fix error introduced in 08f0648 --- upsetplot/plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upsetplot/plotting.py b/upsetplot/plotting.py index 5f9dea9..8d859ab 100644 --- a/upsetplot/plotting.py +++ b/upsetplot/plotting.py @@ -931,8 +931,8 @@ def make_args(val): for rect in rects: height = rect.get_height() + rect.get_y() ax.text( - float(np.ravel(height + margin)[0]), float(np.ravel(rect.get_x() + rect.get_width() * 0.5)[0]), + float(np.ravel(height + margin)[0]), fmt.format(*make_args(height)), ha="center", va="bottom",