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

Rethinking 2 - Chapter 4 - Code 4.61 Plots not on same canvas #130

Closed
gabipana7 opened this issue Dec 7, 2020 · 2 comments
Closed

Rethinking 2 - Chapter 4 - Code 4.61 Plots not on same canvas #130

gabipana7 opened this issue Dec 7, 2020 · 2 comments

Comments

@gabipana7
Copy link

The arviz plots here:
plt.scatter(d2.weight, d2.height) az.plot_hpd(weight_seq, mu_pred.T) az.plot_hpd(d2.weight, height_pred["height"]) plt.plot(weight_seq, mu_mean, "k") plt.xlabel("weight") plt.ylabel("height") plt.xlim(d2.weight.min(), d2.weight.max());
Do not output on the same figure as you have in your notebook. In my notebook everythime I call an az.plot_hdp ( changed to az.plot_hdi ) it goes into another, separate plot ! How do I show everything on top of eachother as you have ?
Screenshot from 2020-12-07 17-54-29

@gabipana7
Copy link
Author

Nevermind, I found out how to do it, after hours of searching
ax = az.plot_hdi(d2.weight, height_pred["height"]) az.plot_hdi(weight_seq, mu_pred.T, ax=ax)
So you just add the 'ax=' on the first one, and add ax=ax to the second one, if anyone else has the problem. I don't know why it works, but it works !

@aloctavodia
Copy link
Member

Thanks for reporting this. The issue is related to arviz-devs/arviz#1452. In previous versions, ArviZ automatically got the axes, but then we made a change that requires users to manually pass the axes. Once the mentioned issue gets merged this will be the case again. So I am keeping this issue open until that.

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