-
-
Notifications
You must be signed in to change notification settings - Fork 11
Add Violin Plot #296
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
base: main
Are you sure you want to change the base?
Add Violin Plot #296
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
==========================================
- Coverage 87.82% 85.71% -2.12%
==========================================
Files 44 45 +1
Lines 5102 5249 +147
==========================================
+ Hits 4481 4499 +18
- Misses 621 750 +129 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is a draft, I skimmed to get the general idea and try and flag places where you might be creating too much work or backing into a corner
# flip x and y coordinates | ||
density_flipped = left_density.rename({"plot_axis": "flipped_plot_axis"}) | ||
density_flipped = density_flipped.assign_coords(flipped_plot_axis=["y", "x"]) | ||
density_flipped = density_flipped.rename({"flipped_plot_axis": "plot_axis"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# flip x and y coordinates | |
density_flipped = left_density.rename({"plot_axis": "flipped_plot_axis"}) | |
density_flipped = density_flipped.assign_coords(flipped_plot_axis=["y", "x"]) | |
density_flipped = density_flipped.rename({"flipped_plot_axis": "plot_axis"}) | |
# flip x and y coordinates | |
density_flipped = left_density.sel(plot_axis=["x", "y"]).assign_coords(plot_axis=["y", "x"]) |
This should achieve the same, and adding the .sel
will make it work even if for some reason the initial dataarray already has y, x as coord values
# flip x and y coordinates | ||
density_flipped = right_density.rename({"plot_axis": "flipped_plot_axis"}) | ||
density_flipped = density_flipped.assign_coords(flipped_plot_axis=["y", "x"]) | ||
density_flipped = density_flipped.rename({"flipped_plot_axis": "plot_axis"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# flip x and y coordinates | |
density_flipped = right_density.rename({"plot_axis": "flipped_plot_axis"}) | |
density_flipped = density_flipped.assign_coords(flipped_plot_axis=["y", "x"]) | |
density_flipped = density_flipped.rename({"flipped_plot_axis": "plot_axis"}) | |
density_flipped = left_density.sel(plot_axis=["x", "y"]).assign_coords(plot_axis=["y", "x"]) | |
density_flipped.loc[{"plot_axis": "x"}] = -density_flipped.sel(plot_axis="x") |
You can get the data as negative like so instead of adding an argument to the visual function
"dist", | ||
"credible_interval", | ||
"point_estimate", | ||
"point_estimate_text", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we'll want the point estimate text in this plot, the other ones can be nice, if you haven't added it yet I don't think it is necessary you do at all
Work in progress (few components remaining)
📚 Documentation preview 📚: https://arviz-plots--296.org.readthedocs.build/en/296/