Skip to content

Commit d7f2ebe

Browse files
committed
add parameter label to annotation functions
1 parent 66c8907 commit d7f2ebe

File tree

2 files changed

+58
-56
lines changed

2 files changed

+58
-56
lines changed

PyComplexHeatmap/annotations.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ def __init__(
6868
legend=None,
6969
legend_kws=None,
7070
ylim=None,
71+
label=None,
7172
**plot_kws
7273
):
7374
self._check_df(df)
74-
self.label = None
75+
self.label = label
7576
self.ylim = ylim
7677
self.color_dict = None
7778
self.nrows = self.df.shape[0]
@@ -111,7 +112,8 @@ def update_plot_kws(self, plot_kws):
111112
self.plot_kws.update(plot_kws)
112113

113114
def set_label(self, label):
114-
self.label = label
115+
if self.label is None:
116+
self.label = label
115117

116118
def set_legend(self, legend):
117119
if self.legend is None:

notebooks/advanced_usage.ipynb

Lines changed: 54 additions & 54 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)