This file contains 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
with sns.plotting_context('notebook', font_scale = 1.4): | |
# ... same as before | |
# Add annotations | |
annotator.new_plot(ax, pairs=pairs, **plotting_parameters) | |
annotator.configure(test='Mann-Whitney', verbose=True).apply_and_annotate() | |
# ... same as before |
This file contains 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
states_palette = states_palette = sns.color_palette("YlGnBu", n_colors=5) | |
states_order = ["Successful", "Failed", "Live", "Suspended", "Canceled"] |
This file contains 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
# Also disabling printed output as it is the same | |
annotator.configure(text_offset=3, verbose=0) |
This file contains 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
# Add annotations | |
annotator.new_plot(ax, **plotting_parameters) | |
annotator.configure(test_short_name="MWW") # text_format is still simple | |
annotator.set_pvalues_and_annotate(pvalues) |
This file contains 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
# Add annotations | |
annotator = Annotator(ax, pairs, **plotting_parameters) | |
annotator.configure(text_format="simple") | |
annotator.set_pvalues_and_annotate(pvalues) |
This file contains 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
with sns.plotting_context("notebook", font_scale = 1.4): | |
# ...Same as previous | |
# Add annotations | |
annotator = Annotator(ax, pairs, **plotting_parameters) | |
annotator.set_pvalues(pvalues) | |
annotator.annotate() | |
# ... same as previous |
This file contains 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
# Putting the parameters in a dictionary avoids code duplication | |
# since we use the same for `sns.boxplot` and `Annotator` calls | |
plotting_parameters = { | |
'data': rfs, | |
'x': 'Subcategory', | |
'y': 'Goal', | |
'palette': subcat_palette[1:] | |
} | |
pairs = [('Robots', 'Flight'), |
This file contains 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
annotator.annotate() |
This file contains 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
annotator.set_custom_annotations(formatted_pvalues) |
This file contains 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
pvalues = [ | |
sci_stats.mannwhitneyu(robots, flight, alternative="two-sided").pvalue, | |
sci_stats.mannwhitneyu(flight, sound, alternative="two-sided").pvalue, | |
sci_stats.mannwhitneyu(robots, sound, alternative="two-sided").pvalue | |
] | |
# pvalues | |
# [0.00013485140468088997, 0.2557331102364572, 0.00022985464929005115] | |
# Transform each p-value to "p=" in scientific notation |