arviz-devs / arviz

Exploratory analysis of Bayesian models with Python
https://python.arviz.org
Apache License 2.0
1.62k stars 407 forks source link

Reorganize layout in Posterior Plot #2080

Open sarinac opened 2 years ago

sarinac commented 2 years ago

Tell us about it

The posterior plot example has a lot going on, and it takes a while to figure out where all the numbers (text objects) refer to.

Why it's difficult to read:

Thoughts on implementation

2 proposed options:

image

Proposed changes:

OriolAbril commented 2 years ago

Thanks, these are great suggestions!

I think we should probably split it in two though. One part is improving the layout of the plot_posterior function, another is working on the examples using plot_posterior in the example gallery. I really like the first layout proposal, however, I think we should generally avoid having all the elements present in the same plot. plot_posterior is a bit of one-stop-shop covering many tasks. When it comes to the example gallery, I would probably have 3-4 examples using plot_posterior with different target tasks.

We could do something like

The rope and ref_val examples don't even need to have the hdi and point estimate visible, they can be hidden and it is probably a good idea to showcase that too in the example gallery. I am partial to hiding both hdi and point estimate when showing either rope or ref_val, but not very opinionated on this

canyon289 commented 2 years ago

Agree, lets split this into the parts Oriol recommended. The new mockups already look way nicer. Id suggest making those changes first, then working on exampel gallery second

OriolAbril commented 2 years ago

I see both as independent tasks, but I would start with the example gallery work. If we do have the example gallery examples updated, we can use them as visual tests when the PR for the mockup changes is ready, we wouldn't need to copy paste the generated images into the PR description (and update them every time we make a new commit to the PR).

I will also be working on refactoring the API starting this September. I am not sure about the rest of ArviZ people, but I won't be able to make the changes to the codebase to follow the mockup layout (and doing them means doing them twice with no re-use of the work between matplotlib and bokeh with the current codebase). I also don't think it would be a good use of @sarinac time to wrangle with the codebase, api and so on to implement this herself. At least not until we have improved layout suggestions and example plots for all arviz functions.