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
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
# 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
# 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
# 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
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
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
# Add annotations | |
annotator.new_plot(ax, **plotting_parameters) | |
annotator.configure(text_format="full", verbose=False).apply_and_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
pairs = [ | |
("Successful", "Failed"), | |
("Successful", "Live"), | |
("Failed", "Live"), | |
("Canceled", "Successful"), | |
("Canceled", "Failed"), | |
("Canceled", "Live") | |
] | |
state_plot_params = { |
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): | |
# Create new plot | |
ax = get_log_ax() | |
# Plot with seaborn | |
ax = sns.boxplot(ax=ax, | |
data=rfs, | |
x='Subcategory', y='Goal', | |
order=subcat_order, | |
hue="State", |