Prevent Matplotlib voxels from shading facecolors

23 Views Asked by At

I use voxels on Matplotlib. I would like to display a cube, but without shadows on certain faces. I want all faces to have exactly the same color. I browsed the documentation but didn't managed to find how.

How could I do that ?

Below is my code, an image of what it displays, and an example of how I would like it looks like.

import matplotlib.pyplot as plt
import numpy as np


x, y, z = np.indices((8, 8, 8))
voxel = (x < 8) & (y < 8) & (z < 8)
ax = plt.figure().add_subplot(projection='3d')
ax.voxels(voxel, edgecolors='k')

plt.show()

Output of the code above Treated image, example of how I would like it looks like

0

There are 0 best solutions below