Closed xqqe closed 1 year ago
In this graph, the annotations are supposed to go from pink (LN) to pink, but they only go from green (HN) to green and I can't figure out what's wrong. I've attached the image and the code I used for this particular graph below.
order = list(set(df['Genotype'])) order.sort() pairs = [[('A3GK', 'LN'), ('COL', 'LN')], [('COL', 'LN'), ('GV5', 'LN')]] hue_order = ['NN','HN','LN'] plot_params = { 'data': df, 'x': 'Genotype', 'y': 'PR_Length', "order": order, "hue": 'Condition'} plot = sns.boxplot(**plot_params,hue_order = hue_order) annotator = Annotator(plot, pairs, **plot_params) annotator.configure(test='Mann-Whitney', verbose=1) annotator.apply_test() annotator.annotate() sns.move_legend(plot, "upper left", bbox_to_anchor=(1, 1)) plt.show()
Hello, It looks like you kept hue_order out of plot_params, and passed it to sns.boxplot but not to Annotator.
hue_order
plot_params
sns.boxplot
Annotator
Was that it?
I think it was. Thanks for your help and for following up.
In this graph, the annotations are supposed to go from pink (LN) to pink, but they only go from green (HN) to green and I can't figure out what's wrong. I've attached the image and the code I used for this particular graph below.