Comments (4)
Hello @xinyuejohn , thank you for the question. Sorry this is yet poorly documented, and part 2 of the tutorial is long overdue...
(There is an example in the test suite:
statannotations/tests/test_integrate_annotator.py
Lines 73 to 87 in 2a5ebe1
So basically should be using g.map_dataframe
instead of g.map
(this should really be in the docstring, I'm sorry), and thus provide the arguments directly to that function.
For your snippet, something like this:
annot = Annotator(None, pairs)
plot_and_annotate_facets = annot.plot_and_annotate_facets(
# deducing
plot_params = {
'x': feature_name,
'y': value_name
}
g = sns.FacetGrid(
data=plot_df,
col="Cell type"
)
g.map_dataframe(
annot.plot_and_annotate_facets,
plot='boxplot',
plot_params=plot_params,
configuration=configuration,
annotation_func='set_custom_annotations',
annotation_params=annotation_params,
**kwargs
)
Please let us know if something is still not working.
from statannotations.
Hello @xinyuejohn , thank you for the question. Sorry this is yet poorly documented, and part 2 of the tutorial is long overdue... (There is an example in the test suite:
statannotations/tests/test_integrate_annotator.py
Lines 73 to 87 in 2a5ebe1
)
So basically should be usingg.map_dataframe
instead ofg.map
(this should really be in the docstring, I'm sorry), and thus provide the arguments directly to that function.
@trevismd Thank you so much for your reply! Your reply really helped a lot. But I still have some issue about pairs.
For example, in your test suite, you used self.simple_pairs as pairs. But if I want to only plot for some of the pairs ([(("a", "blue"), ("b", "blue"))]) instead of [["a", "b"]], I will get an error: Missing x value(s) "('a', 'blue')", "('b', 'blue')"
in x (specified in pairs
) in data
Could you please tell me if I can use such pairs when I plot? Thank you so much!
from statannotations.
hello @trevismd. you have here a great tool that a lot are interested in, however, it is not documented well. I find it a complete waste of time running between the different parts of codes/informations you gave for each comment trying hard to link them together. Would it be possible to provide a working example, from start to end, well documented, for adding annotations to catplot (grouped box plot output)? many thanks
from statannotations.
after 2h I managed to came over the following...
https://github.com/trevismd/statannotations/issues/36#issuecomment-1866210714
I still see a detailed doc will help with tweaking this amazing tool (e.g. between group stat rather than within group stat from catplot output, and more...)
from statannotations.
Related Issues (20)
- What does * (ns) mean? HOT 3
- report corrected p values
- Integration with new Numpy and Seaborn? HOT 1
- Seaborn categorical plot issue HOT 1
- How to plot facet grid with hue argument? HOT 5
- Possible to not show non-significant relationships? HOT 1
- Feature request: Text format that combines both numerical p-values and stars
- Possible to get statistics and p-values when using FacetGrid?
- How to keep two decimal places with text_format='full' HOT 1
- v0.60 not compatible with seaborn v0.13 HOT 10
- Add ANOVA?
- Feature request: Lineplot support
- Customize Annotations HOT 1
- Adding Tutorials to documentation site
- Use src/ folder for package
- Offset the significance brackets
- Feature request: permutation test
- Getting rid of minor tick marks
- Stannotation with scanpy and seaborn HOT 1
- No possibility to get statannotations to work with seaborn, pandas, and numpy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statannotations.