GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — Voxels 3d colorizer v2 by trygvrad · Pull Request #31032 · matplotlib/matplotlib Conversation
Contributor
PR summaryThis PR is in response to and closes #22969 [ENH]: Voxels as mappable for colorbar This change allows axes3d.voxels() to take scalar data as input, and map it to color using a colorbar. The colors are applied to the voxels before shading. The following code demonstrates the new functionality: import numpy as np import matplotlib.pyplot as plt #Mock data X,Y,Z = np.meshgrid(np.linspace(0,5,10), np.linspace(0,5,10), np.linspace(0,5,10), indexing="ij") Hist = np.zeros((9,9,9)) Hist[2,5,5], Hist[5,5,3], Hist[5,7,5], Hist[5,0,5] = 1, 55, 4, 39 Hist[5,1,5] = 39 Hist[Hist == 0] = np.nan # plot fig=plt.figure() ax = fig.add_subplot(projection='3d') res = ax.voxels(X, Y, Z, Hist, cmap='rainbow', norm='log', alpha=0.5) fig.colorbar(res) res.colorizer.norm.vmin = 3
The technical implementation is such that:
Technical implementationThis technical implementation changes the return type of class VoxelDict(mcolorizer._ColorbarMappable, collections.abc.MutableMapping):
class _ColorizerInterface: ... class _ColorbarMappable(_ColorizerInterface): """ Base class for objects that can connect to a colorbar. All classes that can act as a mappable for `fig.colorbar(mappable)` will subclass this class. """ ... class _ScalarMappable(_ColorbarMappable): ... class ColorizingArtist(_ScalarMappable, artist.Artist): ... I believe this change in the class hierarchy is suitable, because it makes explicit the requirements for colorbar. Next stepFirst we need a discussion about the merits of the technical implementation. If there is agreement that this implementation is suitable, I will need to add more tests.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
2 of 5 tasks
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
trygvrad
force-pushed
the
voxels_3d_colorizer_v2
branch
from
5bba200 to
5f78c20
Compare
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
4 tasks
Contributor
Author
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This threads the needle much more cleanly than the last PR, thanks for putting it together. Could you please add a test with a new baseline image, as well as a whats new entry?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you @scottshambaugh
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThis branch has not been deployedNo deployments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersAt least 1 approving review is required to merge this pull request. Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. [ENH]: Voxels as mappable for colorbarUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |