Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use statannotations in FaceGrid of seaborn #120

Open
ryrl9703 opened this issue May 5, 2023 · 3 comments
Open

how to use statannotations in FaceGrid of seaborn #120

ryrl9703 opened this issue May 5, 2023 · 3 comments

Comments

@ryrl9703
Copy link

ryrl9703 commented May 5, 2023

I just want to draw a figure by FacetGrid in seaborn and add test in it just like the example in the homepage, how should I do?
Xnip2023-05-05_10-16-31

@trevismd
Copy link
Owner

trevismd commented Jun 9, 2023

Hi!
You should use the plot_and_annotate_facets function, see some documentation here: https://statannotations.readthedocs.io/en/latest/statannotations.html#statannotations.Annotator.Annotator.plot_and_annotate_facets, to read if/when you are familiar with the basic flows of the package explained in the example notebook or the blog post.

@JohannesWiesner
Copy link

I also would like to do this but I cannot find any tutorial on this. Seems like this figure (example_2facets.png) only appears in the README but nowhere in the tutorials

@trevismd
Copy link
Owner

trevismd commented Oct 1, 2023

Here should be the code to this image (with the dataset used in the tutorial, overdue part 2 will cover FacetGrids).

annot = Annotator(None, pairs)

g = sns.FacetGrid(sf, col='State', height=12, sharey=False)
g.map_dataframe(annot.plot_and_annotate_facets, plot='boxplot',
                plot_params=plotting_parameters,
                configuration={"test": "Mann-Whitney"}, annotation_func="apply_test",
                ax_op_before=[["set_yscale", ["log"], {}]])
g.set_axis_labels("Technology Subcategory", "Goal")
g.fig.patch.set_alpha(1)
plt.show()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants