0

I have this cube that ive displayed using voxels.

enter image description here

I need to rotate it like the image above. I've tried np.rot and scipy.ndimage.interpolate.rotate with no success.

Could someone point me in the right direction

Cube = np.rand.rand(8,8,10) < .5
ax = plt.figure().add_subplot(projection=‘3d’)
ax.voxels(cube)
Plt.show()
Krnzy
  • 1
  • 2
  • Do you need to display at a different angle or actually rotate the data. Definitely need to update your question with some code showing a sample of the data as well as how you're plotting it. – gnodab Aug 10 '21 at 19:48
  • did you try this? https://stackoverflow.com/a/49179544/9703451 – raphael Aug 10 '21 at 19:51
  • Updated. Just need to rotate the data – Krnzy Aug 10 '21 at 19:55
  • @raphael thanks! think did what I needed it to – Krnzy Aug 10 '21 at 20:12
  • Does this answer your question? [How can I rotate a 3d array (nxnxn) by x degrees around x, y, and z axes?](https://stackoverflow.com/questions/49097667/how-can-i-rotate-a-3d-array-nxnxn-by-x-degrees-around-x-y-and-z-axes) – raphael Aug 10 '21 at 20:21

1 Answers1

0

You can try:

ax.view_init(elev=None, azim=None)
plt.show()

elev = stores the elevation angle in the z plane.

azim = stores the azimuth angle in the x,y plane.