I am trying to visualize 3D data. This is a complete 3D matrix: each coordinate (x, y, z) matters, unlike a surface or a set of separate data vectors. The way I'm trying to do this is to build an opaque cube, where each edge of the cube displays the sum of data in orthogonal dimension.
Some examples of data are mainly blob centered at (3,5,7):
import numpy as np (x,y,z) = np.mgrid[0:10,0:10, 0:10] data = np.exp(-((x-3)**2 + (y-5)**2 + (z-7)**2)**(0.5)) edge_yz = np.sum(data,axis=0) edge_xz = np.sum(data,axis=1) edge_xy = np.sum(data,axis=2)
Thus, the idea would be to create a 3D graph showing a cube; on each surface of the cube the corresponding two-dimensional matrix edge_ * will be displayed. It would be like building 3 4-sided polygons in the corresponding three-dimensional positions (or 6, if you would also make the back sides of the cube), except that each polygon is actually a matrix of values โโthat will be displayed in color.
My best approximation at the moment is to compute large matrices containing skewed versions of the edge, and combine them into one large two-dimensional matrix and imshow (), which is a large matrix. It seems rather awkward, and does a lot of work that some kind of engine in matplotlib or m3plot or something that I'm sure is already doing. It also only works for viewing a static image from one viewing angle, but thatโs not what I need to overcome at the moment.
Is there a good way to build these cube faces in real 3D using an existing python tool? Is there a better way to build a 3D matrix?
source share