Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
This has conflicts that need resolving - for one, all the PEP8 fixes were already made in another PR. |
motorny left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
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)
Of note: this is NOT the same effect, as |
PR Summary
Fixes#9535 by adding handling for the facecolors keyword, both in combination with cmap and without.
PR Checklist