Plotting XYZ Coordinates in 3D with Matlab

Click For Summary
SUMMARY

The discussion focuses on plotting two sets of 11 XYZ coordinates in 3D using MATLAB to visualize displacement. The user aims to connect corresponding points with arrows to illustrate movement, while also differentiating the two sets by color. Key MATLAB commands mentioned include 'plot3' for plotting points and 'quiver3' for drawing arrows between points. The use of 'hold on' and 'hold off' commands is also emphasized for managing multiple plots on the same figure.

PREREQUISITES
  • Familiarity with MATLAB programming environment
  • Understanding of 3D plotting concepts in MATLAB
  • Knowledge of using loops in MATLAB for iterative plotting
  • Basic understanding of line specifications in MATLAB for customizing plots
NEXT STEPS
  • Explore MATLAB's 'plot3' command documentation for advanced plotting techniques
  • Learn how to use 'quiver3' for vector field visualization in MATLAB
  • Research the use of 'hold on' and 'hold off' commands for managing multiple plots
  • Investigate line specifications ('linespec') in MATLAB to enhance plot aesthetics
USEFUL FOR

This discussion is beneficial for data analysts, researchers, and engineers who need to visualize 3D coordinate data and illustrate changes in position using MATLAB.

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: 666
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 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K