Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ax.voxels
alpha
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
Trying to plot a volume inside a volume, with one ax.voxels call, doesn't seem possible:
import matplotlib.pyplot as plt import numpy as np from matplotlib import colors inner = np.zeros((4, 4, 4), dtype=bool) inner[1:3, 1:3, 1:3] = 1 outer = np.ones((4, 4, 4), dtype=bool) voxelarray = inner | outer facecolors = np.empty(voxelarray.shape + (4,), dtype=object) facecolors[outer] = colors.to_rgba("blue", alpha=0.5) facecolors[inner] = colors.to_rgba("red") fig = plt.figure() ax = fig.add_subplot(projection="3d") ax.voxels(voxelarray, facecolors=facecolors) fig.savefig("nested_volumes.png")
Nest volumes are possible if invoking ax.voxels twice:
outer_facecolors = np.empty(outer.shape + (4,), dtype=object) outer_facecolors[outer] = colors.to_rgba("blue", alpha=0.5) inner_facecolors = np.empty(inner.shape, dtype=object) inner_facecolors[inner] = "red" fig = plt.figure() ax = fig.add_subplot(projection="3d") ax.voxels(outer, facecolors=outer_facecolors) ax.voxels(inner, facecolors=inner_facecolors) ax.set_axis_off() plt.tight_layout() fig.savefig("nested_volumes.png", transparent=True)
It would be nice if matplotlib supported alpha with voxels for nested volumes.
matplotlib
voxels
Related: https://stackoverflow.com/questions/48672663/matplotlib-render-all-internal-voxels-with-alpha, which leads to the dupe #9745 that was closed due to inactivity
The text was updated successfully, but these errors were encountered:
Bar3DCollection
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Problem
Trying to plot a volume inside a volume, with one
ax.voxels
call, doesn't seem possible:Nest volumes are possible if invoking
ax.voxels
twice:Proposed solution
It would be nice if
matplotlib
supportedalpha
withvoxels
for nested volumes.Related: https://stackoverflow.com/questions/48672663/matplotlib-render-all-internal-voxels-with-alpha, which leads to the dupe #9745 that was closed due to inactivity
The text was updated successfully, but these errors were encountered: