简体   繁体   中英

Plot 3D mesh using 3D numpy array and 2D numpy array

I have a 3D numpy array Lattice[][][], and a 2D numpy array Trajectory[][]. I want the indices i/j/k of Lattice to be the coordinate axes and the value contained in the tensor element to be plotted as a colored dot, making a 3D mesh maybe and I want to plot Trajectory where the Trajectory[p][0]/[1]/[2] contains the coordinates, and the index p is the iteration number - so this I want to plot as a 3D line, hopefully inside the mesh. I have no idea from where to start, is it possible in matplotlib?

You could definetly use matplotlib. Check this link:https://matplotlib.org/2.0.2/mpl_toolkits/mplot3d/tutorial.html

But you could also try a different package, like Plotly: https://plotly.com/python/3d-charts/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM