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

Fixed plot_trace legend overwriting by chain legend (Issue #2320) #2334

Merged
merged 9 commits into from
Apr 8, 2024

Conversation

imperorrp
Copy link
Contributor

@imperorrp imperorrp commented Mar 26, 2024

Description

Addresses Issue #2320 , where chain legend seemed to overwrite fist subplot legend that displays coord combinations.

When the chain legend is created (.legend(handles=handles, title="chain", loc="upper right")), passing this to second subplot in the plot generated, which is the first trace plot (ax.figure.axes[1]) instead of the first subplot, which is the first density plot and already has a legend (ax.figure.axes[0]) prevents overwriting. As per @OriolAbril 's suggestion in the issue comments of #2320 .

Here are the plots now generated with this small edit, with no overwriting:

fixed_traceplot fixed_traceplot2

Checklist

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

📚 Documentation preview 📚: https://arviz--2334.org.readthedocs.build/en/2334/

@imperorrp
Copy link
Contributor Author

Test failures seem to be from an issue with checking axes[0,0] for the chain legend- could this test be modified?

@OriolAbril
Copy link
Member

Test failures seem to be from an issue with checking axes[0,0] for the chain legend- could this test be modified?

Yes, it needs to be modified. Once you have you can check the " Includes new or updated tests to cover the new feature" box

@imperorrp
Copy link
Contributor Author

Test failures seem to be from an issue with checking axes[0,0] for the chain legend- could this test be modified?

Yes, it needs to be modified. Once you have you can check the " Includes new or updated tests to cover the new feature" box

Sure, will modify test as appropriate

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.

If you click at the "details" link of the failing job you'll eventually get to this page: https://dev.azure.com/ArviZ/ArviZ/_build/results?buildId=6712&view=logs&jobId=52053870-44e4-57aa-b540-f1a2d094f440&j=52053870-44e4-57aa-b540-f1a2d094f440&t=b4fdbffc-b4d0-53ca-c47c-a902d6813a77.

It looks like there is a trailing whitespace somewhere. You can run black which will get rid of it and if necessary to any other formatting changes needed. With that and adding a line to the Changelog in maintenance and bug fixes section it will be ready to merge.

@imperorrp
Copy link
Contributor Author

If you click at the "details" link of the failing job you'll eventually get to this page: https://dev.azure.com/ArviZ/ArviZ/_build/results?buildId=6712&view=logs&jobId=52053870-44e4-57aa-b540-f1a2d094f440&j=52053870-44e4-57aa-b540-f1a2d094f440&t=b4fdbffc-b4d0-53ca-c47c-a902d6813a77.

It looks like there is a trailing whitespace somewhere. You can run black which will get rid of it and if necessary to any other formatting changes needed. With that and adding a line to the Changelog in maintenance and bug fixes section it will be ready to merge.

Sure, just did that. Seems some doc/ files got formatted too- is that alright or is black formatting not supposed to be run on that folder?

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.84%. Comparing base (339991b) to head (c7c1e73).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2334   +/-   ##
=======================================
  Coverage   86.84%   86.84%           
=======================================
  Files         123      123           
  Lines       12745    12745           
=======================================
  Hits        11068    11068           
  Misses       1677     1677           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OriolAbril
Copy link
Member

It's ok yeah, don't worry.

@OriolAbril
Copy link
Member

Let's add a bullet point to the changelog to check the last box and merge

@imperorrp
Copy link
Contributor Author

Let's add a bullet point to the changelog to check the last box and merge

Sure, just did that

@OriolAbril OriolAbril merged commit cfbfbeb into arviz-devs:main Apr 8, 2024
0 of 9 checks passed
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.

2 participants