Creating 3D Scatter Plot in Matlab - Ashley, IU Chemistry

In summary, the conversation is about a person needing help with importing data for a 3D plot in Matlab. They are struggling with understanding the function xlsread and the use of 's' and 'c' variables in the Scatter3 function. They are advised to use the MatLab documentation to learn and to use different functions such as surface and scatter to achieve the desired plot.
  • #1
ASidebottomIU
3
0
Hello

I am very new to Matlab and need help on importing my data for a 3D plot. Currently, I have x,y,z data that I am trying to import to look like Figure 5 in the following paper:

http://www.nature.com/nmeth/journal/v4/n5/fig_tab/nmeth1038_F5.html

I have no idea how to import the data from an excel file- any help would be appreciated. Thank you!

Ashley
IU Chemistry
 
Physics news on Phys.org
  • #2
investigate the function xlsread

Code:
help xlsread
 
Last edited:
  • #3
The issue is that I am not sure what the extra 's' and 'c' fields are that are required for Scatter3 (x,y,z,s,c). I want to relate both x and y to z- an actual step-by-step would be most helpful as I am struggling to relate the script to the plot tools gui.

Ashley
 
  • #4
ASidebottomIU said:
The issue is that I am not sure what the extra 's' and 'c' are...

S may be used to set the size of the dots on the scatter plot, and C may be used to set the color of the points. You can to learn this yourself using MatLab documentation.

But scatter3 will not produce a plot like either Figure5 a) or Figure 5 b).

To produce a plot like figure 5 a), you could use http://www.mathworks.com/help/techdoc/ref/surface.html".

Figure 5. b) is 2d so one would just use http://www.mathworks.com/help/techdoc/ref/scatter.html" to get something similiar. You could use multiple calls to scatter with "hold on;" to plot the different colors or dot sizes.
 
Last edited by a moderator:
  • #5
Thank you MisterX for your reply- it definitely helped and I have figured it out!
 

What is a 3D scatter plot?

A 3D scatter plot is a type of graph that uses three axes to represent data points in a three-dimensional space. It is commonly used in scientific fields, such as chemistry, to visualize relationships between three variables.

Why is Matlab used for creating 3D scatter plots?

Matlab is a powerful software tool that allows for efficient and accurate data analysis and visualization. It has built-in functions and tools specifically designed for creating 3D plots, making it an ideal choice for scientists and researchers who need to create complex graphs.

What are the steps for creating a 3D scatter plot in Matlab?

The steps for creating a 3D scatter plot in Matlab are:

  1. Load the data set into Matlab.
  2. Define the variables to be plotted on each axis.
  3. Use the scatter3() function to plot the data points in a 3D space.
  4. Customize the plot by adding labels, titles, and adjusting the axis limits and appearance.
  5. Save the plot as an image or export it for use in other applications.

What are some advantages of using a 3D scatter plot?

Some advantages of using a 3D scatter plot include:

  • It allows for the visualization of relationships between three variables, which can be difficult to see in a 2D plot.
  • It can reveal patterns or trends that may not be apparent in other types of graphs.
  • It is useful for identifying outliers or clusters in the data.
  • It can be rotated and viewed from different angles, providing a more comprehensive understanding of the data.

Are there any limitations to using a 3D scatter plot?

Yes, there are some limitations to using a 3D scatter plot, including:

  • It can be difficult to accurately interpret the data when there are multiple data points overlapping in the same region.
  • It may not be suitable for visualizing large datasets, as it can become cluttered and difficult to read.
  • It requires a certain level of familiarity with Matlab and its functions to create and customize the plot.
  • It may not be the most effective way to visualize relationships between more than three variables.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
143
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top