pyplot
)https://matplotlib.org/3.5.3/api/_as_gen/matplotlib.pyplot.html
pyplot_3d.py
fig = plot.figure()
ax = fig.add_subplot(111, projection='3d')
x, y, z = np.indices(array_3D.shape)
values = array_3D.flatten()
sc = ax.scatter(x.flatten(), y.flatten(), z.flatten(), c=values, s=100)
cbar_ax = fig.add_axes([0.9, 0.15, 0.05, 0.7])
cbar = fig.colorbar(sc, ax=ax, cax=cbar_ax, shrink=0.5, aspect=5)
ax.set_title('3D Array Visualization')
ax.set_xlabel('Rows')
ax.set_ylabel('Columns')
ax.set_zlabel('Depth')
ax.set_xticks(np.arange(array_3D.shape[0]))
ax.set_yticks(np.arange(array_3D.shape[1]))
plot.show()
lesson_3.ipynb
.