From 7dc6f2a374e5c4ddd522cd7901d59295fffce5af Mon Sep 17 00:00:00 2001 From: Pascal <65159092+pas-calc@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:41:28 +0100 Subject: [PATCH] Add text_kwargs parameter to annotate methods --- statannotations/Annotator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/statannotations/Annotator.py b/statannotations/Annotator.py index 229d3c5..27bbe78 100644 --- a/statannotations/Annotator.py +++ b/statannotations/Annotator.py @@ -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() @@ -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 @@ -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() @@ -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: