Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add 3D scatter test for cmap update#30062

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

MiniX16
Copy link
Contributor

PR summary

This PR adds a new test to verify that changing the colormap of a 3D scatter plot (Axes3D.scatter) after drawing the figure properly updates the face colors.

Why is this change necessary?

There was previously no test ensuring that colormap updates on 3D scatter plots are reflected after a figure draw. This test ensures consistency with 2D behavior and guards against regressions.

What problem does it solve?

Confirms that callingset_cmap() after drawing does in fact update the plotted colors in 3D, which has historically been a bug but seems to be fixed.

What is the reasoning for this implementation?

The test draws a 3D scatter plot with an initial colormap ('jet'), forces a draw, changes the colormap to'viridis', and compares it against a reference plot created directly with'viridis'.

This ensures the update mechanism behaves correctly post-render.

Minimal example

sc=ax.scatter(x,y,z,c=values,cmap='jet')fig.canvas.draw()sc.set_cmap('viridis')

Closes#18931


PR checklist

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

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

Thanks a lot - looks good to me.

MiniX16 reacted with laugh emoji
@oscargus
Copy link
Member

Thanks and congratulations on your first merged PR in Matplotlib. Looks that there may be two soon. Hoping to see you around!

MiniX16 reacted with laugh emoji

@oscargusoscargus merged commit35c5481 intomatplotlib:mainMay 18, 2025
39 checks passed
@QuLogicQuLogic added this to thev3.11.0 milestoneMay 20, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.11.0
Development

Successfully merging this pull request may close these issues.

3D collections do not proper handleedgecolor='face'
4 participants
@MiniX16@oscargus@dstansby@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp