Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions statannotations/Annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def reset_configuration(self):

return self

def annotate(self, line_offset=None, line_offset_to_group=None):
def annotate(self, line_offset=None, line_offset_to_group=None, text_kwargs={}):
"""Add configured annotations to the plot."""
self._check_has_plotter()

Expand Down Expand Up @@ -234,6 +234,7 @@ def annotate(self, line_offset=None, line_offset_to_group=None):
ax_to_data=ax_to_data,
ann_list=ann_list,
orig_value_lim=orig_value_lim,
text_kwargs=text_kwargs,
)

# reset transformation
Expand Down Expand Up @@ -503,7 +504,7 @@ def _check_has_plotter(self):
"Not plotter is defined. If `get_empty_annotator` was used, "
"`new_plot` must be called to provide data")

def _annotate_pair(self, annotation, ax_to_data, ann_list, orig_value_lim):
def _annotate_pair(self, annotation, ax_to_data, ann_list, orig_value_lim, text_kwargs={}):

if self._verbose >= 1: # pragma: no branch
annotation.print_labels_and_content()
Expand Down Expand Up @@ -553,6 +554,7 @@ def _annotate_pair(self, annotation, ax_to_data, ann_list, orig_value_lim):
clip_on=False,
annotation_clip=False,
**xy_params,
**text_kwargs,
)

if annotation.text is not None:
Expand Down