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

[FIX] Fix overlapping titles for plot_matrix function #3899

Merged
merged 3 commits into from Aug 18, 2023

Conversation

ymzayek
Copy link
Member

@ymzayek ymzayek commented Aug 9, 2023

Changes proposed in this pull request:

  • Simplify how title is added to matrix plots and make use of tight_layout for automatic adjustment
  • Update relevant tests

Relevant to the following examples:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

👋 @ymzayek Thanks for creating a PR!

Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.

Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.

  • PR has an interpretable title.
  • PR links to Github issue with mention Closes #XXXX (see our documentation on PR structure)
  • Code is PEP8-compliant (see our documentation on coding style)
  • Changelog or what's new entry in doc/changes/latest.rst (see our documentation on PR structure)

For new features:

  • There is at least one unit test per new function / class (see our documentation on testing)
  • The new feature is demoed in at least one relevant example.

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

We will review it as quick as possible, feel free to ping us with questions if needed.

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #3899 (38751aa) into main (45187e7) will decrease coverage by 0.08%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3899      +/-   ##
==========================================
- Coverage   91.60%   91.53%   -0.08%     
==========================================
  Files         134      134              
  Lines       15751    15750       -1     
  Branches     3281     3280       -1     
==========================================
- Hits        14429    14417      -12     
- Misses        772      784      +12     
+ Partials      550      549       -1     
Flag Coverage Δ
macos-latest_3.10 91.53% <100.00%> (-0.01%) ⬇️
macos-latest_3.11 91.53% <100.00%> (-0.01%) ⬇️
macos-latest_3.8 91.49% <100.00%> (-0.01%) ⬇️
macos-latest_3.9 91.49% <100.00%> (?)
ubuntu-latest_3.10 91.53% <100.00%> (-0.01%) ⬇️
ubuntu-latest_3.11 91.53% <100.00%> (-0.01%) ⬇️
ubuntu-latest_3.8 91.49% <100.00%> (-0.01%) ⬇️
ubuntu-latest_3.9 91.49% <100.00%> (-0.01%) ⬇️
windows-latest_3.10 91.47% <100.00%> (-0.01%) ⬇️
windows-latest_3.11 91.47% <100.00%> (-0.01%) ⬇️
windows-latest_3.8 91.43% <100.00%> (-0.01%) ⬇️
windows-latest_3.9 91.43% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
nilearn/plotting/matrix_plotting.py 93.50% <100.00%> (-0.03%) ⬇️

... and 11 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ymzayek
Copy link
Member Author

ymzayek commented Aug 10, 2023

For review see full build here: https://output.circle-artifacts.com/output/job/a9439351-08ed-476f-808e-6cb69147e4ce/artifacts/0/dev/auto_examples/index.html

This did break a test that checks the title, however it's using a private attribute of matplotlib.image.AxesImage. I updated the test in commit 38751aa. However, maybe this needs to be dealt with in a different way or keep the original text method but configure the parameters better. What do others think?

@Remi-Gau
Copy link
Collaborator

edited the top comment with links to the after version of each plot

@Remi-Gau
Copy link
Collaborator

For review see full build here: https://output.circle-artifacts.com/output/job/a9439351-08ed-476f-808e-6cb69147e4ce/artifacts/0/dev/auto_examples/index.html

This did break a test that checks the title, however it's using a private attribute of matplotlib.image.AxesImage. I updated the test in commit 38751aa. However, maybe this needs to be dealt with in a different way or keep the original text method but configure the parameters better. What do others think?

TBF I think this is fine as it is. 😃

@Remi-Gau Remi-Gau merged commit 058adcd into nilearn:main Aug 18, 2023
28 of 29 checks passed
@ymzayek ymzayek deleted the matrix_plot_titles branch August 18, 2023 08:45
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.

None yet

2 participants