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

[DOC] update colormap example #4851

Merged
merged 7 commits into from
Feb 19, 2025
Merged

[DOC] update colormap example #4851

merged 7 commits into from
Feb 19, 2025

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Dec 2, 2024

Changes proposed in this pull request:

  • present nilearn colormaps horizontally
  • give some tips on what colormpas to use
  • change some default map to RdBu_r (missed in a previous PR)
  • use strings for cmaps name as much as possible
  • rely on matplotlib bwr colormap rather than provide our own

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Dec 2, 2024

trying to better match this page of the matploblib doc: https://matplotlib.org/stable/users/explain/colors/colormaps.html#overview

Copy link
Contributor

github-actions bot commented Dec 2, 2024

👋 @Remi-Gau 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.

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.32%. Comparing base (872607a) to head (371283f).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
nilearn/plotting/matrix_plotting.py 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4851      +/-   ##
==========================================
- Coverage   94.32%   94.32%   -0.01%     
==========================================
  Files         143      143              
  Lines       18636    18630       -6     
  Branches     3105     3105              
==========================================
- Hits        17578    17572       -6     
  Misses        548      548              
  Partials      510      510              
Flag Coverage Δ
macos-latest_3.10_plotting 93.37% <66.66%> (-0.01%) ⬇️
macos-latest_3.11_plotting 93.36% <66.66%> (-0.01%) ⬇️
macos-latest_3.12_plotting 93.37% <66.66%> (-0.01%) ⬇️
macos-latest_3.13_plotting 93.37% <66.66%> (-0.01%) ⬇️
macos-latest_3.9_min 70.30% <0.00%> (+0.02%) ⬆️
macos-latest_3.9_plot_min 92.09% <66.66%> (-0.01%) ⬇️
macos-latest_3.9_plotting 93.34% <66.66%> (-0.01%) ⬇️
ubuntu-latest_3.10_plotting 93.37% <66.66%> (-0.01%) ⬇️
ubuntu-latest_3.11_plotting 93.37% <66.66%> (-0.01%) ⬇️
ubuntu-latest_3.12_plotting 93.37% <66.66%> (-0.01%) ⬇️
ubuntu-latest_3.13_plotting 93.37% <66.66%> (-0.01%) ⬇️
ubuntu-latest_3.13_pre 93.37% <66.66%> (-0.01%) ⬇️
ubuntu-latest_3.9_plotting 93.34% <66.66%> (-0.01%) ⬇️
windows-latest_3.10_plotting 93.33% <66.66%> (-0.01%) ⬇️
windows-latest_3.11_plotting 93.33% <66.66%> (-0.01%) ⬇️
windows-latest_3.12_plotting 93.33% <66.66%> (-0.01%) ⬇️
windows-latest_3.13_plotting 93.33% <66.66%> (-0.01%) ⬇️
windows-latest_3.9_plotting 93.31% <66.66%> (-0.01%) ⬇️

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

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

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Dec 4, 2024

@bthirion
Copy link
Member

bthirion commented Dec 5, 2024

I don't really like this example: it simply repeats matplotlib with little Nilearn-specificity. Its is also very technical with local functions etc, and does not comprise detailed explanations nor insights into what should be used for what purpose.

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Dec 5, 2024

Any suggestions on how to then explain why the nilearn colormaps are better than the ones in matplotlib and how to guide user on how to choose amongst them ?
Because at the moment the colormap example is too bare bone.

@bthirion
Copy link
Member

bthirion commented Dec 5, 2024

Use colormaps on a simple image to give a critical view on the pros and cons of each ?

Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

LGTM

@Remi-Gau Remi-Gau marked this pull request as ready for review February 19, 2025 07:34
@Remi-Gau Remi-Gau requested a review from man-shu February 19, 2025 13:30
Copy link
Contributor

@man-shu man-shu left a comment

Choose a reason for hiding this comment

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

LGTM! The codecov failure is weird -- no lines are flagged

@Remi-Gau
Copy link
Collaborator Author

Yeah I was confused by that as well.

@Remi-Gau Remi-Gau merged commit 9bb90f3 into nilearn:main Feb 19, 2025
33 of 34 checks passed
@Remi-Gau Remi-Gau deleted the doc/colors branch February 19, 2025 15:55
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.

3 participants