Plotting XYZ Coordinates in 3D with Matlab

In summary, the speaker is seeking help with plotting 2 sets of 11 xyz coordinates of beads in 3D, representing a displacement of each point. They have successfully plotted the points in OriginLab but are unsure how to connect the points in Matlab. They suggest using the 'plot3' command and a for loop, as well as the 'quiver3' command for adding arrows between points. They also mention adjusting the "linespec" for a better visual representation.
  • #1
nritzakis
1
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: 588
Physics news on Phys.org
  • #2
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
 
  • #3
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.
 

What is Matlab and why is it used for plotting XYZ coordinates in 3D?

Matlab is a scientific programming language and software environment that is commonly used in engineering, mathematics, and scientific research. It is used for plotting XYZ coordinates in 3D because it has powerful built-in functions and tools for creating and manipulating 3D visualizations.

How do I import my XYZ coordinate data into Matlab for plotting?

To import your XYZ coordinate data into Matlab, you can use the "importdata" function or the "load" function. These functions allow you to load data from a variety of file formats, such as text files or spreadsheets, into your Matlab workspace.

What is the syntax for plotting XYZ coordinates in 3D using the "plot3" function in Matlab?

The syntax for the "plot3" function in Matlab is as follows:
plot3(X,Y,Z)
where X, Y, and Z are vectors or matrices containing the coordinates of the points to be plotted. You can also specify additional properties, such as color and marker type, in the function call.

Can I customize the appearance of my 3D plot in Matlab?

Yes, you can customize the appearance of your 3D plot in Matlab by using various plotting functions and properties. For example, you can change the color and size of the plot markers, add a title and axis labels, and adjust the viewing angle and perspective of the plot.

Is it possible to save my 3D plot as an image or video in Matlab?

Yes, you can save your 3D plot as an image or video in Matlab by using the "saveas" or "VideoWriter" functions, respectively. These functions allow you to save your plot in a variety of file formats, such as PNG, JPEG, or AVI, for further analysis or presentation purposes.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
711
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
697
Back
Top