-
-
Notifications
You must be signed in to change notification settings - Fork 11
Adding Ridgeplot to Arviz-Plots #57
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
=======================================
Coverage ? 85.75%
=======================================
Files ? 17
Lines ? 1951
Branches ? 0
=======================================
Hits ? 1673
Misses ? 278
Partials ? 0 ☔ 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.
There should be two visual elements that generate the ridge: the edge (already implemented and working) and the face (filling the area of the kde). This will match the behaviour of current plot_ridge (via plot_forest), see for example: https://python.arviz.org/en/stable/examples/plot_forest_ridge.html.
As always either or both can be turned off. Regarding defaults, I think having the edge have the default color is great, for the area I think using the same color as the default would mean having an data-ink ratio too low, we could use color="white", alpha=0.4
or something like that to help with visualizing overlap between ridges but keeping a "clean" look (that would look quite weird for backgrounds other than white though like arviz-darkgrid
style), or we could use plot_kwargs.setdefault("face", False)
to skip it by default but giving users the option to turn it on.
API question (needs discussion before any implementation): I think it would probably be nice to have a shortcut/syntactic sugar to have both edge and face use the same properties, but I am not sure how much worth it it would be.
src/arviz_plots/plots/ridgeplot.py
Outdated
sample_dims=None, | ||
rescale_kde=None, | ||
plot_ridge_base=None, | ||
combined=False, |
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 think combined=True
might be a better default from plot_ridge
src/arviz_plots/plots/ridgeplot.py
Outdated
coords=None, | ||
sample_dims=None, | ||
rescale_kde=None, | ||
plot_ridge_base=None, |
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 would also remove this one
src/arviz_plots/plots/ridgeplot.py
Outdated
plot_kwargs : mapping of {str : mapping or False}, optional | ||
Valid keys are: | ||
|
||
* ridge -> passed to :func:`~visuals.line_xy` |
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.
Given the natural meaning of "ridge", I think it makes sense as the plot name and as the name of the whole axes at the right of the figure, but similarly to plot_forest
not so much for a single visual element. Here we could have edge and face as the visual elements.
src/arviz_plots/plots/ridgeplot.py
Outdated
for var in density.data_vars: | ||
density[var].loc[{"plot_axis": "y"}] = density[var].sel(plot_axis="y") ** rescale_kde |
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.
This type of transformation should not be an option. kdes are already hard enough to interpret (even if they look simple and we believe we can read them with ease that is not the case). I would not add this as this makes it basically impossible to actually read anything from the kde other than the range and the position of the peak.
By rescaling I meant multiplying all kdes by a common scale factor in order to preserve all proportions in the curve but having the tallest one peak at height 1 (or something else, this could be user modified, similarly to the overlap control argument there is in current plot_forest
).
for var in density.data_vars: | |
density[var].loc[{"plot_axis": "y"}] = density[var].sel(plot_axis="y") ** rescale_kde | |
for var in density.data_vars: | |
density.loc[{"plot_axis": "y"}] = density.sel(plot_axis="y") / density.sel(plot_axis="y").max().to_array().max() * ridge_height |
where ridge_height
regulates the height of the ridge (that is, the height of the tallest peak in the ridge). If ridge_height=1
(or lower) there should be no overlap at all (when combined=True and there aren't multiple models) with higher values there will be some area overlap (>1 but smallish should mean area overlap but no edge overlap generally, >>1 will generally mean both are and edge overlap). Once both area and edge plotting are working, we should try several values like 1, 1.5, 2 and see with the example arviz datasets how each looks.
src/arviz_plots/visuals/__init__.py
Outdated
def line_xy(da, target, backend, **kwargs): | ||
def line_xy(da, target, backend, y=None, **kwargs): | ||
"""Plot a line x vs y. | ||
|
||
The input argument `da` is split into x and y using the dimension ``plot_axis``. | ||
If an additional y argument is provided, y is added to the values in the `da` | ||
dataset sliced along plot_axis='y'. | ||
""" | ||
plot_backend = import_module(f"arviz_plots.backend.{backend}") | ||
return plot_backend.line(da.sel(plot_axis="x"), da.sel(plot_axis="y"), target, **kwargs) | ||
da_has_y = "plot_axis" in da.dims and "y" in da.plot_axis | ||
if da_has_y: | ||
y = da.sel(plot_axis="y") if y is None else da.sel(plot_axis="y") + y | ||
if y is None: | ||
raise ValueError("Unable to find values for y in `da`") | ||
return plot_backend.line(da.sel(plot_axis="x"), y, target, **kwargs) |
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.
This should use the same pattern as annotate_label
or point_estimate_text
. That is
- Both x and y are arguments of the function, both default to
None
- the actual x and y values are obtained with
x, y = _process_da_x_y(da, x, y)
(combining values from the function arguments and the different dataarray coordinate values as needed).
…isual elements `line_xy` and `fill_between_y`
Renamed the ridge artist to edge and added the face artist. I had to modify the Also moved the kde rescaling code to just after statistical computation so that a new dataset About the default color for face- I've just used the same one as for edge for now but with the alpha=0.4 added. Have left the bit about face/edge using the same properties for now as well, for after discussion like you said. Also added some tests, with style drawn from the existing ones for Here's how the plots look like now: When combined==True (by default)When combined==False |
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.
Tried adding some hypothesis tests but there were issues with that so I haven't committed those changes yet.
Try manually generating a plot_ridge without the edge and another without the face. The hypothesis test if you copied it from the plot_forest one is failing at least due to that
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 have added a couple comments for the visuals, to make sure we can combine x
and y
as aesthetics along with the data provided by the plots.
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.
Looking at the code again, I think for maximum flexibility we should modify the _process_da_x_y
so the function keeps only the logic of combining the x
and y
coordinate values in da
(if any) with the x
and y
arguments (if any). Thus all following possibilities are valid:
(da) # with x, y in plot_axis
(da, x, y) # with x, y in plot axis, returns da.sel(x) + x, da.sel(y) + y
(da, x, y) # without x, y in plot axis, returns x, y
(da, x) # with x, y in plot axis, returns da.sel(x) + x, da.sel(y)
(da, x) # without x, y in plot axis, returns x, da
# basically the same changing x for y too
This means that if we (functions in plots module) provide the data via da
, both x and y can be used as aesthetics and will work as expected.
Then have a different function _ensure_scalar
to make sure things that are supposed to be scalars are actually scalars and not 0-dimensional arrays, dataarrays with a single element or anything of the sort.
Overall:
def _process_da_x_y(da, x, y):
"""Process da, x and y arguments into x and y values."""
da_has_x = "plot_axis" in da.dims and "x" in da.plot_axis
da_has_y = "plot_axis" in da.dims and "y" in da.plot_axis
if da_has_x:
x = da.sel(plot_axis="x") if x is None else da.sel(plot_axis="x") + x
if da_has_y:
y = da.sel(plot_axis="y") if y is None else da.sel(plot_axis="y") + y
if x is None and y is None:
raise ValueError("Unable to find values for x and y.")
if x is None:
x = da
elif y is None:
y = da
return x, y
def _ensure_scalar(*args):
return tuple(arg.item() if hasattr(arg, "item") else arg for arg in args)
With that, line_xy
should use x, y = _process_da_x_y(da, x, y)
directly, and the text related functions that currently use it should use x, y = _ensure_scalar(_process_da_x_y(da, x, y))
src/arviz_plots/visuals/__init__.py
Outdated
"""Fill the region between to given y values.""" | ||
if y_bottom is None and y: |
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.
Side comment is that if y_bottom is None and y
would evaluate y
as a boolean, thus, y_bottom=None, y=0
would not enter the if. Not relevant with the other behavioural comment though
src/arviz_plots/visuals/__init__.py
Outdated
if y_bottom is None and y: | ||
y_bottom = y | ||
if y_top is None and y: | ||
y_top = y |
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 think I would modify this to make sure things behave as expected. x
and y
are mostly used so we can have aesthetics x
and y
that control shifting the visual elements within a plot. Therefore, I would expect that if I pass y
, everything is shifted along the vertical axes. With these checks, if I give both y_top
and y
this won't happen.
I would use
if y is not None:
y_top += y
y_bottom += y
once the if "kwarg" in da.dims:
finishes as then both y_top and y_bottom should be array_like elements and not None.
Yeah I just checked this- since the current code calls the density calculation function only if |
Modified density calculation to occur if either one of edge_kwargs or face_kwargs is not False, indicating that it is required to be calculated for plotting to be possible. Also added the visual element function changes and hypothesis tests code, which appears to pass now for plot_ridge |
src/arviz_plots/plots/ridgeplot.py
Outdated
# rescaling kde | ||
ridge_height = 1 # default | ||
density.loc[{"plot_axis": "y"}] = ( | ||
density.sel(plot_axis="y") | ||
/ density.sel(plot_axis="y").max().to_array().max() | ||
* ridge_height | ||
) | ||
# (f"\n printdensity = {density!r}") |
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.
This should be outside the catch_warnings context. The catch_warnings is used to prevent a warning being printed when we have subsets of the data that are all nan (which happens when we have multiple models with different variables/coordinate values). It is not something that means anything, so we don't want users to see warnings that are not actionable. If it appears when there is a single model then it is an actual issue with the model/sampling, so we do want to print it hence why the filterwarnings is only active when multiple models are present.
src/arviz_plots/visuals/__init__.py
Outdated
def point_estimate_text( | ||
da, target, backend, *, point_estimate, x=None, y=None, point_label="x", **kwargs | ||
): | ||
"""Annotate a point estimate.""" | ||
x, y = _process_da_x_y(da, x, y) | ||
x, y = _ensure_scalar(*_process_da_x_y(da, x, y)) | ||
point = x if point_label == "x" else y | ||
if point.size != 1: |
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.
This should be np.size(point)
now
src/arviz_plots/visuals/__init__.py
Outdated
if x is not None or y is not None: # if either x or y is provided as an arg | ||
x, y = _process_da_x_y(da, x, y) | ||
else: | ||
x = da.sel(plot_axis="x") | ||
y = da.sel(plot_axis="y") |
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.
if x is not None or y is not None: # if either x or y is provided as an arg | |
x, y = _process_da_x_y(da, x, y) | |
else: | |
x = da.sel(plot_axis="x") | |
y = da.sel(plot_axis="y") | |
x, y = _process_da_x_y(da, x, y) |
* First commit for adding ridgeplot * Updated `plot_ridge` with 'face' and 'edge' artists now and updated visual elements `line_xy` and `fill_between_y` * Modified density calculation pre-check in plot_ridge and modified visual element functions * Added hypothesis tests for plot_ridge * Added ridge_height as a top level arg and other modifications * final changes --------- Co-authored-by: Oriol (ProDesk) <[email protected]>
improve plot_posterior and add tests for it add minimal docstrings add init to test folder update plot_posterior add some docs add docs and implement some feedback improve api docs ignore mystnb warning add plot_trace (arviz-devs#1) * add trace plot * use convert_to_datatree in tests * fix linters * Add to draft API docs --------- Co-authored-by: Oriol Abril-Pla <[email protected]> rename plot_posterior and small improvements fix test rename source file add style add styles update intro plotcollection update intro plotcollection add ecdf to distplot draft trace_dens draft trace_dens draft Update src/arviz_plots/plots/tracedensplot.py Co-authored-by: Oriol Abril-Pla <[email protected]> Update src/arviz_plots/plots/tracedensplot.py Co-authored-by: Oriol Abril-Pla <[email protected]> Update src/arviz_plots/plots/utils.py Co-authored-by: Oriol Abril-Pla <[email protected]> Update src/arviz_plots/plots/utils.py Co-authored-by: Oriol Abril-Pla <[email protected]> fix missing argument try fixing docs fix docs Issue was due to wrong handling of try except. To avoid depending on matplotlib, it is imported within a try except to register the colormaps and styles, but then it is deleted from the namespace which was happening outside the try except and so arviz_plots failed to import on envs without matplotlib rename dens -> dist update api index Add legend method to PlotCollection and improve docs (arviz-devs#32) * start work on legend and improve docs * add anchor placeholder * work on docs * add backend functions to docs and improve plot_collection docs * add missing files * extend api docs * first attempt at bokeh legend * make no-duplication of backend api docs work * run pre-commit * fix and docs on generate_aes_dt * doc improvements * some doc extensions * improve plot_dist docs * fix bokeh legend generation * add warning to legend method Add plot_forest and tests (arviz-devs#34) * some improvements to PlotCollection * add classmethod tests * add more tests * add divergences to plot_trace * extend tests * add divergence data to test_plots * add plot_forest draft For everything to work, the following features were added to: * support for "__variable__" in aesthetics * default values for common aesthetics * support for dict of datatree input -> multiple models aligned within the same plot * add labels to plot_forest still some backend elements missing for bokeh * further improvements to plot_forest * invert y aes to preserve order top-down * improvements to aes_map defaults and shading * attempt support for InferenceData inputs * plot_dist support for multiple models and docs * update dependencies * add more tests * raise error on wrong use of combined * better support for aesthetics in labels elements Add neutral element concept to aes generation (arviz-devs#35) * First try at neutral element * Fix syntax * Try fixing syntax and improve readability * Fix shade aes default * update and extend tests * update aes_dt to aes_dict conversion * run tests with coverage on CI Fixes and improvements to plot_trace_dist (arviz-devs#36) * very rough draft to fix aesthetic mapping defaults * fix plot_trace_dist and add tests * use neutral element for combined elements * add example to plot_trace Extend and rerun tutorials (arviz-devs#38) * add xlabel to plot_trace * rerun plots_intro notebook * update leftover arviz-base references * write use plotcollection notebook and some improvements * fix scale_fig_size defaults * switch docs theme, default to light version PlotCollection coords attribute for better composability (arviz-devs#39) * prepare reuse of plotting functions * call plot_trace within plot_trace_dist * use plot_dist in plot_trace_dist * add contributing section to docs * fix doc warnings * fix dark-light issue with backend logos * write new_plot docs * improve neutral element behaviour and docs * fix a couple cross-references add none backend and hypothesis tests (arviz-devs#41) * add none backend and hypothesis tests * add more tests with hypothesis and scheduled actions * fix hypothesis yaml syntax * use unset as default for none backend so keys are filtered * add branch reference to issue add codecov token (arviz-devs#42) change action to create issue/comment (arviz-devs#44) fix hypothesis action (arviz-devs#46) * add condition to run if testing failed * try fixing branch name * try adding a more specific link to action logs * switch pytest-store_date command order Prepare initial pre-release (arviz-devs#54) * add links between sub-libraries * bump version * use accessor in plot_forest docstring * bump version and configure publishing Fix issue in plot_dist_trace (arviz-devs#64) don't try to rename artists if they haven't been drawn Adding Ridgeplot to Arviz-Plots (arviz-devs#57) * First commit for adding ridgeplot * Updated `plot_ridge` with 'face' and 'edge' artists now and updated visual elements `line_xy` and `fill_between_y` * Modified density calculation pre-check in plot_ridge and modified visual element functions * Added hypothesis tests for plot_ridge * Added ridge_height as a top level arg and other modifications * final changes --------- Co-authored-by: Oriol (ProDesk) <[email protected]> Removed unused 'extra_data' arg (arviz-devs#73) Add plotly backend and gallery prototype (arviz-devs#61) * plotly backend proof of concept * be more consistend with kwarg handling and defaults * restructure backend dependencies and install process * fix typo in bokeh's remove_ticks * complete plotly backend * gallery prototype * extend docs and tests * add plotly equivalences to glossary * more sensible defaults and kwarg handling * automate gallery generation via sphinx extension * figsize and gallery related fixes * full fledged gallery * remove unused references * update gallery generator * initial plotly support for styles * fix gallery generator processing add pp-obs comparison with plot_forest example (arviz-devs#74) * add pp-obs comparison with plot_forest example * improve example expand style functionality (arviz-devs#75) * expand style functionality * add feedback * Apply suggestions from code review Co-authored-by: Oriol Abril-Pla <[email protected]> --------- Co-authored-by: Oriol Abril-Pla <[email protected]> Improve backend documentation and get plot_forest to follow best practices (arviz-devs#78) * start working on best practices and backend docs * use none backend as documentation base * add images for plotly and none * adapt minigallery directive * use none backend instead of arviz_plots.backend * gallery references and plot sizing improvements * fix typo * pylint * wait until using sphinx 8 * pseudo fix for empty minigallery * modify slightly auto sizing * Apply suggestions from code review Co-authored-by: Osvaldo A Martin <[email protected]> * add see also --------- Co-authored-by: Osvaldo A Martin <[email protected]> Histogram support addition to distplot.py (arviz-devs#47) * WIP histogram addition to distplot.py * Added histogram computing if kind='hist' * reformatted histogram dataarrays into a dataset * Modified histogram dataset plot_axis coords to 'x' and 'y' and added visual element function, backend interface and matplotlib backend function for plotting histogram * Allowing xarray_einstats.histogram() function to determine default number of bins * Modified histogram data restructuring function to include bin edge data and modified docstrings for hist backend interface * added plot_dist test parametrizations for kind=kde, hist, ecdf, adjusted hypothesis time limit to 2 seconds and modified backend hist plotting function * added width to histogram plotting, removed print statements from previous commits and updated restructure_hist_data() docstring * switched histogram computation to arviz stats, modified plot_hist visual element slightly for new returned hist density data structure * added 'density=True' to normalize histogram heights and removed axis by default for histograms * added Bokeh backend for hist visual element and removed ecdf parametrization from test_plot_dist_models * updated docstring, added 'alpha' argument to the 'hist' backend plotting functions, renamed 'plot_hist' to 'hist', modified `remove_axis` logic slightly and set density=True as default in stats_kwargs * Added 'hist' to visuals.rst * deactivate tests for hist kind and multiple models It needs a fix in arviz-stats to work * removed restructure_dist and glyph default artist kwarg in bokeh * updated hist backend interface and matplotlib hist backend function with updates fromrootogram plot * plotly hist and plot_dist improvements --------- Co-authored-by: Oriol Abril-Pla <[email protected]> Add plot_compare (arviz-devs#77) * add plot_compare * directly use plot_backend * add new kwargs * use fill_between_y * docs * remove commented code * use plot_kwargs * use plotcollection * use plotcollection * alow disabling elements * pass pc_kwargs to plotcollection * try to fix example in gallery * add missing import * Update gallery_generator.py * Improve show method for plotcollection * fix 1x1 grid generation in plotly * fix plotly 1x1 plots * add basic test * fix tests * isort * remove redundant array conversion --------- Co-authored-by: Oriol Abril-Pla <[email protected]> rework styles (arviz-devs#88) * rework color palletes * update plotly clean template fix link to github (arviz-devs#91) Add ESS Plot (arviz-devs#58) * First commit for essplot and scatter_xy visual element * update for ess plot and addition of 'x' aesthetic for 'model' dim * addition of quantile plot and updated x aesthetic mapping * Added rugplot to essplot * updates to essplot * fixed default value for arg 'extra_methods' * modified scatter_xy visual element to take into account _process_da_x_y update * Added color/linestyles aesthetics and simplified min_ess plotting * Added annotate_xy visual element, applied to essplot for extra_methods * visual element vertical alignment logic modification and arviz-stats compute_ranks addition attempt * added docs for essplot * tests for essplot * added scatter_xy to visuals.rst * added rug=True to example gallery plot_ess_local * fixes for rugplot issue and hypothesis test failures * shifted mean_ess, sd_ess computing to before plot_kwargs check+artist plotting logic and modified hypothesis tests * Updated plot_ess and tests * updated .toml file for arviz-stats dependency * Modified figsize to more of a plot_forest approach, fixed order of plots in plots.rst and expanded max limit for test methods in testplots.py in .pylintrc * Updated plot_ess docstring * Switched from .grid to .wrap, removed unused figsize coeffs, disabled pylint warning on testplots.py * final fixes now only waiting for us to figure out behaviour and scope in arviz-stats and xarray-einstats * update pyproject requirements * pylint --------- Co-authored-by: Oriol (ProDesk) <[email protected]> fix warning (arviz-devs#99) Adding Plot ESS Evolution (arviz-devs#71) * Initial ess evolution plot updated plot_ess_evolution including a common ess_dataset computing func added mean and sd annotations like essplot docs and example gallery for plot_ess_evolution updated verticalalign logic for mean/sd and correct (although overlaid and not flattened yet) rug is now displayed removed rug plot added tests updated scatter_xy func to plot_ess version fixed docstring altered store_artist for xlabel, ylabel and modified hypothesis tests shifted mean_ess, sd_edd computing to before plot_kwargs check+artist plotting logic updated docstring, added figsizing and set vertical_align for mean and sd text kwargs as setdefault removed 'rankdata' branch of arviz-stats from dependencies docstring typo fix gallery-generator updated for documentation building * remove visual duplicated when rebasing --------- Co-authored-by: Oriol (ProDesk) <[email protected]> Add plot_psense_dist (arviz-devs#93) * Add plot_psense_dist * Update src/arviz_plots/plots/psensedistplot.py Co-authored-by: Oriol Abril-Pla <[email protected]> * Update src/arviz_plots/plots/psensedistplot.py Co-authored-by: Oriol Abril-Pla <[email protected]> * concat da and simplify logic * set sample_dims to sample * refactor * minor fixes and update pyproject to install from GH * support sample_dims argument and all backends * add minigallery to docstring * tweak example * ensure pointinterval only plot does not have yticks * add initial test for psense plot * add test and example * fix test * fix docstring * rename __group__ --------- Co-authored-by: Oriol Abril-Pla <[email protected]> pin datatree and prepare release (arviz-devs#103) * pin datatree and prepare release * update naming for hist_dim to match arviz-stats install arviz-base/stats from github (arviz-devs#104) move out new_ds to arviz-stats (arviz-devs#102) Bump codecov/codecov-action from 4 to 5 (arviz-devs#107) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> update version, dependencies and CI (arviz-devs#110) * update version, dependencies and CI * skip 3.13 until numba release * update rtd env * ignore line too long in gallery template string Use DataTree class from xarray (arviz-devs#111) * start work for xarray datatree compatibility * use datatree from xarray * fix docs * remove unused import Update pyproject.toml (arviz-devs#113) Add energy plot (arviz-devs#108) * add energy plot * remove __variable__, add example * hardcode sampler_dims * use legend only with matplotlib Add plot for distribution of convergence diagnostics (arviz-devs#105) * Add plot for distribution of convergence diagnostics * add ref_line and methods for r-hat * fix docstring * rename, add example * update gallery example * use rhat instead of rhat_rank * update sphinx.configuration key * update sphinx.configuration key * add vline/hline. Co-authored-by: Oriol Abril-Pla <[email protected]> * fix test * fix docstring * fix docstring --------- Co-authored-by: Oriol Abril-Pla <[email protected]> Add separated prior and likelihood groups (arviz-devs#117) * Add separated prior and likelihood groups * upper bound for plotly Add psense_quantities plot (arviz-devs#119) * add psense_quantities plot * remove comment * fix conflicting dimension * update docts * fix color * fix ls * split quantities * fix docstring rename arviz-clean to arviz-variat (arviz-devs#120) rename arviz-clean to arviz-variat add cetrino and vibrant styles to plotly (arviz-devs#121) psense: fix facetting and add xlabel (arviz-devs#123) * fix facetting * add x-label Add summary dictionary arguments (arviz-devs#125) * add summary dictionary arguments * fix spelling plotly: change format of title update in backend (arviz-devs#124) * plotly: change format of title update in backend * update the pyproject.toml file to restrict lower bound of plotly version to 6 Update glossary.md (arviz-devs#126) Add PAV-adjusted calibration plot (arviz-devs#127) * draft pava ppc * add pava-adjusted calibration plot * use dt * fix var name upper bound plotly (arviz-devs#128) use isotonic function that work with datatrees (arviz-devs#131) add reference, fix xlabel (arviz-devs#132) Fix bug when setting some plot_kwargs to false (arviz-devs#134) * fix bug setting when setting some plot_kwargs to false * remove references Add citations (arviz-devs#135) * add citations * reformat citations * fix indentation * fix links * add reference file use <6 version of plotly for documentation and use latest for other purposes (arviz-devs#136) * temporary fix for plotly-plot-rendering-on-webpage * include plotly also in readthedocs fix see algo pava gallery (arviz-devs#137) Add plot_ppc_dist (arviz-devs#138) * add plot_ppc_dist * remove comments * add test and small fixes * fix typo Add warning message for discrete data (arviz-devs#139) * add warning message for discrete data * do not fail on warnings rename plot_pava and minor fixes (arviz-devs#140) fix excesive margins (arviz-devs#141) add arviz-style for bokeh (arviz-devs#122) * add arviz-styles for bokeh * add arviz-styles for bokeh * Update arviz-variat.yml * add more styles Add rootogram (arviz-devs#142) fix examples (arviz-devs#144) Reorganize categories in the gallery (arviz-devs#145) * reorganize categories gallery * update condig * rename remove plots from titles (arviz-devs#146) * remove plots from titles * more renaming * more renaming consistence data_pairs, remove markers pava (arviz-devs#152) added functionality of step histogram for all three backends (arviz-devs#147) * added functionality of step histogram for all three backends * changed user preference format for step histograms * clean * little modifications to make it compatible with cleaned code and to have consistent edgecolor * added test for plot_dist with step value as true * minor fixes: step hist test is not required for 'none' backend --------- Co-authored-by: aloctavodia <[email protected]> use continuous outcome for plot_ppc_dist example (arviz-devs#154) add grid visual (arviz-devs#155) all test cases are passed ruff changes seperating plotting functionality of bayes_factor testing get_plotting funcitonality new implementation of arviz-plot Update bfplot.py it should be something like this. Please, check that it works properly, add docstrings and improve when necessary Improved the plot_bf() function, applied fixes, and added additional assert for test cases Fixed the check for ref_val Added a docstring for plot_bf() Change the backend from matplotlib to none Added a legend to componenet_groups Added few more asserts in test cases Did some other minor fixing and refractoring Signed-off-by: PiyushPanwarFST <[email protected]> Enhance plot_bf() Visualization & Documentation, Fix Linter Issues Adjusted and re-centered BF values for better graph representation. Added plot_bf() function to the documentation. Resolved pylint linter errors in code. Signed-off-by: PiyushPanwarFST <[email protected]> deleting some files and modifying some files
First commit for adding ridge plot. As per issue #7, the already implemented forest plot structure was taken as base logic for this plot and the conventions for adding a new plot (https://arviz-plots.readthedocs.io/en/latest/contributing/new_plot.html) have been followed. This plot plots kde ridges instead of credible intervals and point estimates.
I also added two top-level arguments to this plot since I thought they might be useful-
rescale_kde
(rescales kde by raising the 'y' coord values in the density dataset to a power, set to 1 by default. Using exponent here to amplify the peaks so they're more prominently visible because there's a tendency for kdes to appear very flat when plot_ridge() has a lot of subplots stacked)plot_ridge_base
(boolean to choose whether or not to plot a baseline for each ridge. I think this helps in legibility if the ridges overlap each other or have high peaks, especially if the kde was rescaled)Also modified the
line_xy
visual element function to accept an additionaly
argument (set to None by default) which is added toda.sel(plot_axis='y')
if it is not None, so that each ridge is plotted at the correct height corresponding to its labels on the left column. Since the functionality is the same as previously ify
is not provided, this ensures the function works where used already (like inplot_dist()
) without deprecation.📚 Documentation preview 📚: https://arviz-plots--57.org.readthedocs.build/en/57/