-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Added Interactive legend to ppc_plot bokeh #1602
Conversation
@OriolAbril could you look into this? Thanks |
Codecov Report
@@ Coverage Diff @@
## main #1602 +/- ##
==========================================
+ Coverage 90.86% 90.88% +0.02%
==========================================
Files 108 108
Lines 11620 11652 +32
==========================================
+ Hits 10558 10590 +32
Misses 1062 1062
Continue to review full report at Codecov.
|
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.
Thanks!
if legend: | ||
legend = Legend( | ||
items=legend_it, | ||
location="center_right", |
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 that the legend is fixed, I would place it on the top left, which will generally be en empty corner for both kde and cdf plots. https://arviz-devs.github.io/arviz/examples/plot_ppc_cumulative.html https://arviz-devs.github.io/arviz/examples/plot_ppc.html
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.
@OriolAbril could you please review this? Thanks |
@Rishabh261998 Thank you for this contribution. Can a small test be added or amended to cover this line? |
@canyon289 for line 313?
|
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.
Regarding tests, I would make a copy of https://github.com/arviz-devs/arviz/blob/main/arviz/tests/base_tests/test_plots_bokeh.py#L880 without the parametrizations, name it test_plot_ppc_textsize and call plot_ppc using textsize
) | ||
ax_i.add_layout(legend) | ||
if textsize is not None: | ||
ax_i.legend.label_text_font_size = str(textsize) + "pt" |
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 use an f-string here instead of adding strings
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.
@OriolAbril Done!
* Added interactive legend to ppc_plot bokeh * Minor Change * Updated CHANGELOG and positioned legend * Added test for textsize in ppc_plot bokeh
Description
To fix #1563
I have added an interactive legend to
ppc_plot
in bokeh.Is the position of the legend is good enough?
Checklist