MATLAB Plotting XYZ Coordinates in 3D with Matlab

AI Thread Summary
The discussion revolves around plotting two sets of 11 xyz coordinates in 3D using Matlab to visualize the displacement of beads. The user seeks to create a before-and-after representation, connecting corresponding points with arrows. While they have successfully plotted the points in OriginLab, they struggle to identify which points correspond to the same beads. Suggestions include using Matlab's 'plot3' command to plot the points and 'quiver3' to draw arrows between them. It is recommended to utilize a for loop and the 'hold on' command to overlay multiple plots. Additionally, adjusting the appearance of the data points to resemble spheres can enhance the visualization.
nritzakis
Messages
1
Reaction score
0
Hi all

This is my first time here, so I will do my best to explain what I need help with.

I have 2 sets of 11 xyz coordinates of some beads that I would like to plot in 3D. I want to show them in 3 space as a before and after (to represent a displacement of each point). I was able to plot the points in OriginLab, but for some points, I cannot tell which two points represent the same beads.

I would like to use Matlab to plot each set of points (on the same 3D plot) connected by an arrowhead which points from the set 1 point to the set 2 point. I have a feeling that would complicated, so perhaps just have each set of points connected, and all the set 1 points be one color, and all the set 2 points be another color.

I hope I didn't confuse you. I included the OriginLab plot as a reference.
 

Attachments

  • Graph01.jpg
    Graph01.jpg
    21.4 KB · Views: 646
Physics news on Phys.org
nritzakis, check out Matlab's help on the 'plot3' command.

Code:
help plot3

Also you will want to use a for loop. To plot multiple plots on the same plot on MATLAB you use
Code:
hold on

then to turn it off

Code:
hold off
 
I would use the 'plot3' command to plot the points and then use 'quiver3' to plot the arrows between the points. For making your data points look (somewhat) as spheres, look into the documentation for "linespec" (line specification) and adjust it appropriately when you call the 'plot3' command.
 

Similar threads

Replies
1
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
1
Views
3K
Replies
2
Views
2K
Replies
2
Views
3K
Replies
3
Views
7K
Replies
1
Views
2K
Back
Top