Last active
July 25, 2021 13:51
-
-
Save trevismd/63a87f3b6d7005d79cbd13543f90428a to your computer and use it in GitHub Desktop.
A horizontal barplot
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 = {**hue_plot_params, | |
'x': 'Goal','y': 'State', | |
'dodge': True, 'orient': 'h'} | |
with sns.plotting_context("notebook", font_scale=1.4): | |
# Create new plot | |
ax = get_log_ax('h') | |
# Plot with seaborn | |
ax = sns.barplot(ax=ax, **hue_plot_params) | |
# Add annotations | |
annotator = Annotator(ax, pairs, plot='barplot', **hue_plot_params) | |
annotator.configure(test="Mann-Whitney", comparisons_correction="BH", | |
verbose=False, loc="outside").apply_and_annotate() | |
# Label and show | |
ax.set_xlabel("Goal ($)") | |
ax.set_ylabel("Project State") | |
plt.title("Goal amounts per project State") | |
ax.legend(loc=(1.05, 0)) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment