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

Remove varname from legend in plotppc #1559

Merged

Conversation

MarcoGorelli
Copy link
Contributor

@MarcoGorelli MarcoGorelli commented Feb 13, 2021

closes #1540

Description

Remove varname from legend in plotppc. Motivation is:

  • it's already the label of the x-axis
  • if the case of multiple plots, then a single legend is still valid

xref #1540 (comment)

Of course the current behavior is problematic, because we have one legend that is supposed to work for both plots but is referring only to the first. So I suggest to have as default one legend and remove from the legend the name of the variable.

Here's what the output from examples/matplotlib/mpl_plot_ppc.py would now look like - note how obs only appears as the label of the x-axis, rather than being repeated in the legend

image

Checklist

  • Follows official PR format
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • Includes new or updated tests to cover the new feature
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matplotlib looks good, thanks for the test! My only comment is boke, does bokeh not show the var names in the legend already?

@MarcoGorelli
Copy link
Contributor Author

Thanks @OriolAbril

I'm not familiar with bokeh, but running the same code with backend='bokeh' gives:

image

so it looks like the Bokeh ppc plots are fine as they are?

@OriolAbril
Copy link
Member

I think the legend should be present, especially thinking about begginers who use the bokeh backend, I don't think we can assume everyone will know what do each of the colors represent. I have seen my fair share of people confused between the observed kde and the pp mean kde for example. We can open an issue to fix that in some other PR if you prefer too and merge this as is.

@MarcoGorelli
Copy link
Contributor Author

Sure, have opened #1563 for that (I'd prefer to keep it separate as it feels different to the issue which this PR addresses)

@OriolAbril OriolAbril merged commit 8e9abcd into arviz-devs:main Feb 14, 2021
@MarcoGorelli MarcoGorelli deleted the remove-var_name-from-ppcplot branch February 14, 2021 19:16
utkarsh-maheshwari pushed a commit to utkarsh-maheshwari/arviz that referenced this pull request May 27, 2021
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

Successfully merging this pull request may close these issues.

plot_ppc only plots one legend if there are multiple observed
2 participants