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 facecolors kwarg to mplot3d/plot_trisurf#12073

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

Draft
TAdeJong wants to merge3 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromTAdeJong:master

Conversation

TAdeJong
Copy link

PR Summary

Fixes#9535 by adding handling for the facecolors keyword, both in combination with cmap and without.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) (N/A)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way (N/A)

hombit, krassowski, and mayrholu reacted with thumbs up emoji
polyc.set_array(facecolors)
else:
avg_z = verts[:, :, 2].mean(axis=1)
polyc.set_array(avg_z)
if vmin is not None or vmax is not None:
polyc.set_clim(vmin, vmax)
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't make sense - why would you set both a colormap and face colors?

Copy link
Author

Choose a reason for hiding this comment

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

I was aiming at behaviour equivalent toplt.scatter: either have 1 float per face to be mapped usingcmap, or a full color specification per face, in which case the cmap argument indeed makes no sense. Looking back the code is however not checking this. I will revisit tonight and try to fix conflicts.

@eric-wieser
Copy link
Contributor

This has conflicts that need resolving - for one, all the PEP8 fixes were already made in another PR.

Copy link

@motornymotorny left a comment
edited
Loading

Choose a reason for hiding this comment

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

I have managed to achieve the same effect just by doing:

polyc = ax1.plot_trisurf(tirangulation,solutionTriag,  linewidth=0.2, shade=False)polyc.set_facecolors(facecolors)

deltaeecs, shelvon, and t-bltg reacted with thumbs up emojideltaeecs and shelvon reacted with heart emojideltaeecs reacted with rocket emoji
@krassowski
Copy link
Contributor

Of note: this is NOT the same effect, aspolyc.set_facecolors() only allows to set a single colour, rather than colour for each face/vertex separately.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@eric-wiesereric-wiesereric-wieser left review comments

@motornymotornymotorny left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

plot_trisurf: color and facecolor keyword
6 participants
@TAdeJong@eric-wieser@krassowski@motorny@QuLogic@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp