[英]Plotting a simple 3d numpy array using matplotlib
I want to plot the result of a numerical method for a three dimensional system of ODEs.我想为 ODE 的三维系统绘制数值方法的结果。 My output is in the form (let's suppose we have computed three steps):我的输出采用以下形式(假设我们已经计算了三个步骤):
import numpy as np
v= np.array([[1,2,3], [4,5,6], [7,8,9]])
Where the first value in every 3-tuple is the x coordinate, the second is y coordinate and the third is the z coordinate.每个 3 元组中的第一个值是 x 坐标,第二个是 y 坐标,第三个是 z 坐标。
I would like the most simple and efficient way of plotting these points on a 3D grid.我想要在 3D 网格上绘制这些点的最简单有效的方法。 The problem seems to be that the data should be formated like np.array([[1,4,7], [2,5,8], [3,6,9]])
.问题似乎是数据的格式应该像np.array([[1,4,7], [2,5,8], [3,6,9]])
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.