Last active
July 21, 2021 15:45
-
-
Save trevismd/0667c1b7a4193f395748d0ba58ecdd65 to your computer and use it in GitHub Desktop.
Annotating Plot 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hue_plot_params = { | |
'data': rfs, | |
'x': 'Subcategory', | |
'y': 'Goal', | |
"order": subcat_order, | |
"hue": "State", | |
"hue_order": states_order, | |
"palette": state_palette | |
} | |
with sns.plotting_context("notebook", font_scale = 1.4): | |
# Create new plot | |
ax = get_log_ax() | |
# Plot with seaborn | |
ax = sns.boxplot(ax=ax, **hue_plot_params) | |
# Add annotations | |
annotator = Annotator(ax, pairs, **hue_plot_params) | |
annotator.configure(test="Mann-Whitney").apply_and_annotate() | |
# Label and show | |
add_legend(ax) | |
label_plot_for_subcats(ax) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment