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

Example of "Plot Pair" contours #1773

Closed
MCruzReyes opened this issue Aug 28, 2021 · 4 comments
Closed

Example of "Plot Pair" contours #1773

MCruzReyes opened this issue Aug 28, 2021 · 4 comments

Comments

@MCruzReyes
Copy link

I'm trying to reproduce this example plot given on the GitHub

The code is made to plot confidence contours, however if I copy and paste the code in my computer I get the following error:


TypeError Traceback (most recent call last)
in
17 kde_kwargs={
18 "hdi_probs": [0.3, 0.6, 0.9], # Plot 30%, 60% and 90% HDI contours
---> 19 "contourf_kwargs": {"cmap": "Blues"},
20 },
21 )

~\Anaconda3\envs\pmf\lib\site-packages\arviz\plots\pairplot.py in plot_pair(data, group, var_names, filter_vars, coords, marginals, figsize, textsize, kind, gridsize, contour, plot_kwargs, fill_last, divergences, colorbar, ax, divergences_kwargs, scatter_kwargs, kde_kwargs, hexbin_kwargs, backend, backend_kwargs, marginal_kwargs, point_estimate, point_estimate_kwargs, point_estimate_marker_kwargs, reference_values, reference_values_kwargs, show)
270 # TODO: Add backend kwargs
271 plot = get_plotting_function("plot_pair", "pairplot", backend)
--> 272 ax = plot(**pairplot_kwargs)
273 return ax

~\Anaconda3\envs\pmf\lib\site-packages\arviz\plots\backends\matplotlib\pairplot.py in plot_pair(ax, plotters, numvars, figsize, textsize, kind, scatter_kwargs, kde_kwargs, hexbin_kwargs, gridsize, colorbar, divergences, diverging_mask, divergences_kwargs, flat_var_names, backend_kwargs, marginal_kwargs, show, marginals, point_estimate, point_estimate_kwargs, point_estimate_marker_kwargs, reference_values, reference_values_kwargs)
285 var2,
286 ax=ax[j, i],
--> 287 **kde_kwargs,
288 )
289

~\Anaconda3\envs\pmf\lib\site-packages\arviz\plots\kdeplot.py in plot_kde(values, values2, cumulative, rug, label, bw, adaptive, circular, quantiles, rotated, contour, fill_last, figsize, textsize, plot_kwargs, fill_kwargs, rug_kwargs, contour_kwargs, contourf_kwargs, pcolormesh_kwargs, is_circular, ax, legend, backend, backend_kwargs, show, return_glyph, **kwargs)
307 # TODO: Add backend kwargs
308 plot = get_plotting_function("plot_kde", "kdeplot", backend)
--> 309 ax = plot(**kde_plot_args)
310
311 return ax

TypeError: plot_kde() got an unexpected keyword argument 'hdi_probs'

ArviZ version: 0.11.2
matplotlib version: 3.4.2

Maybe i'm using an old version of arviz?

@ahartikainen
Copy link
Contributor

Can you install latest github version

pip install git+https://github.com/arviz-devs/arviz

We are working for a new release in a near future.

@MCruzReyes
Copy link
Author

@ ahartikainen I already installed the latest github version, however I get the same error.

I am using Python 3.7.11

@ahartikainen
Copy link
Contributor

Are you sure that the code is run on latest github version?

If on jupyter, remember to restart the notebook. Also could it be that pip is referring to some other python?

Easiest way to fix this is to call pip with python

python -m pip install git+https://github.com/arviz-devs/arviz

@MCruzReyes
Copy link
Author

Now is working, maybe I was referring to other python version, thank you for your help.

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

2 participants