trevismd / statannotations

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

Work in axes #5

Closed JosephLalli closed 3 years ago

JosephLalli commented 3 years ago

This update does a few things:

1) Instead of positioning annotations above the highest datapoint in the relevant categories, 'calculate_ymaxes' determines the highest drawn object in each x axis category.

2) Converts all coordinates into axes coordinates, and works in those coordinates. This allows for annotations to be drawn independently of the y axis scale. (This feature was very important for the paper I'm working on).

When working in axes coordinates, I've found that setting the ylim to the max y-axis point 1.05 is better than 1.03, but that's an aesthetic decision.

Otherwise I've done my best to minimize the changes from your code.