I am trying to plot a 3D-Array in matplotlib, but I only see a linear output. The expected output was a 10x10x10 cube.
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D points = np.zeros((10, 10, 10)) for x in range(10): for y in range(10): for z in range(10): points[x][y][z] = z fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.scatter(points[:,0],points[:,1],points[:,2]) plt.show()
https://stackoverflow.com/questions/66620151/matplotlib-not-plotting-all-points March 14, 2021 at 09:14AM
没有评论:
发表评论