trevismd / statannotations

add statistical significance annotations on seaborn plots. Further development of statannot, with bugfixes, new features, and a different API.
Other
619 stars 67 forks source link

add: change annotation font color #138

Open JulienRim opened 8 months ago

JulienRim commented 8 months ago

Describe the problem being tackled

I wanted to add the ability to change font color of annotations, as I was generating some plots that had a black background.

Describe the solution and your code changes

I added fontcolor to CONFIGURABLE_PARAMETERS, _DEFAULT_VALUES, and to the Annotator class. It shares the same default value as color. When Annotator is initiated, it will default to the same color as Annotator.color.

Inside _annotate_pair(), I added color=self.fontcolor to ax.annotate(), which enables the text color of the annotation to change.

Describe how you tested your changes

Example usage in this attached pdf from a jupyter notebook export