Skip to content

Add example, Fix get_cmap #213

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

Merged
merged 2 commits into from
Apr 4, 2025
Merged

Add example, Fix get_cmap #213

merged 2 commits into from
Apr 4, 2025

Conversation

vinaysraghavan
Copy link
Collaborator

Add to the example of plotting on the brain by plotting the atlas regions on the brain.

Catch an exception caused by matplotlib 3.9 breaking plt.cm.get_cmap() and replacing it with plt.get_cmap()

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Fixed break in matplotlib 3.9 plt.cm.get_cmap() deprecated
Added example

Any other comments?

Add to the example of plotting on the brain by plotting the atlas regions on the brain.

Catch an exception caused by matplotlib 3.9 breaking plt.cm.get_cmap() and replacing it with plt.get_cmap()Add to the example of plotting on the brain by plotting the atlas regions on the brain.

Catch an exception caused by matplotlib 3.9 breaking plt.cm.get_cmap() and replacing it with plt.get_cmap()

Add to the example of plotting on the brain by plotting the atlas regions on the brain.

Catch an exception caused by matplotlib 3.9 breaking plt.cm.get_cmap() and replacing it with plt.get_cmap()
@vinaysraghavan vinaysraghavan requested a review from Copilot April 4, 2025 23:09
@vinaysraghavan vinaysraghavan self-assigned this Apr 4, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

naplib/utils/surfdist.py:183

  • Consider checking if plt.cm.get_cmap exists using hasattr instead of relying solely on catching AttributeError, which might mask unexpected errors.
try:

examples/brain_plotting/plot_intracranial_electrodes.py:125

  • [nitpick] Consider adding a more descriptive comment header that briefly explains the purpose of the added atlas overlay section.
###############################################################################

@vinaysraghavan vinaysraghavan merged commit 4a3be0d into main Apr 4, 2025
4 checks passed
@vinaysraghavan vinaysraghavan deleted the brain_example_cmapfix branch April 4, 2025 23:20
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.

1 participant