-
-
Notifications
You must be signed in to change notification settings - Fork 13
Add Pareto shape plot #356
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?
Conversation
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.
Not sure if the new helpers here should be in the public API or not. Not too sure how frequently these will be used outside of the Pareto shape plot.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #356 +/- ##
==========================================
- Coverage 86.17% 85.17% -1.01%
==========================================
Files 54 55 +1
Lines 6091 6469 +378
==========================================
+ Hits 5249 5510 +261
- Misses 842 959 +117 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
OriolAbril
left a comment
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 to leave now, will continue the review tomorrow hopefully it is somewhat helpful already
Very useful, thank you! I will need to re-work somethings you've mentioned already and some that @aloctavodia mentioned as well over slack. Hoping to get these changes in early next week! |
OriolAbril
left a comment
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 am a bit unsure about the things we'd want to support and the things we don't want to allow. There are several things we could integrate more with plotcollection machinery which would give more flexibility to the plot, but plotcollection also usually gives more flexibility than what is really needed which can end up meaning more work and less clear behaviour.
| if fig is None: | ||
| return | ||
|
|
||
| if not hasattr(fig.canvas, "mpl_connect"): |
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.
Is this the right way to handle this? It doesn't seem feasible to check for all possible interactive backends (maybe it is?). This works pretty well right now for me.
|
With the recent changes, I added some more examples to the I think this is good for another round of review now. |
src/arviz_plots/plots/khat_plot.py
Outdated
| **khat_kwargs, | ||
| ) | ||
|
|
||
| if show_hlines and hline_values: |
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.
Hlines should display on top, not behind khat values
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.
Will changing this to zorder=3 resolve that? I think that's what I had before, but changed it based on feedback here. I could be wrong though. I think the problem is that scatter points have zorder=2 as well so which ever is drawn first in plot_khat() takes priority.
Or should I just keep this zorder for hlines and just plot the hlines before the scatter in the actual function so they overlay on top?
@expand_aesthetic_aliases
def hline(y, target, *, color=unset, alpha=unset, width=unset, linestyle=unset, **artist_kws):
"""Interface to matplotlib for a horizontal line spanning the whole axes."""
artist_kws.setdefault("zorder", 2)
kwargs = {"color": color, "alpha": alpha, "linewidth": width, "linestyle": linestyle}
return target.axhline(y, **_filter_kwargs(kwargs, Line2D, artist_kws))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.
Plotting hlines first is ok.

Closes #353
📚 Documentation preview 📚: https://arviz-plots--356.org.readthedocs.build/en/356/