'Python 3D voxel plot
I'm trying to represent a 3D voxelized geometry with a certain value for each voxel. I'm loading all values as a float64 variable "data". First I did:
ax = fig.add_subplot(111, projection='3d')
ax.voxels(data, facecolors=plt.cm.gist_heat_r(norm(data)), shade=True, alpha=0.75)
And it worked but not when voxels are of different size, this image is a voxelized geometry (299,148,348) voxels but different size:
So I scaled voxel values as:
ax.localPbAspect = scale
xmin, xmax = ( lim / ax.localPbAspect[0] for lim in ax.get_xlim3d() )
ymin, ymax = ( lim / ax.localPbAspect[1] for lim in ax.get_ylim3d() )
zmin, zmax = ( lim / ax.localPbAspect[2] for lim in ax.get_zlim3d() )
ax.auto_scale_xyz([xmin,xmax], [ymin,ymax], [zmin,zmax])
Where scale is the scaling relation for each axis X Y Z number in (0,1]
It does the scaling but print a huge 3D grid, and if I change the auto_scale axis values it does not scale them:

Is there any way of obtaining this second image scaled but with a small grid axis so the voxelized picture is centered and not in a corner? Thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

