0

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?

Simran Bhake
  • 117
  • 8
  • 1
    I am not 100% sure what you want to achieve but I would look into [Line3DCollection](https://matplotlib.org/stable/api/_as_gen/mpl_toolkits.mplot3d.art3d.Line3DCollection.html) as used, for instance, [here](https://stackoverflow.com/a/65181776/8881141) or [here](https://stackoverflow.com/a/64601416/8881141). – Mr. T Jan 27 '22 at 21:31

1 Answers1

1

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/

rodrigocfaria
  • 440
  • 4
  • 11