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

  • Context: MATLAB 
  • Thread starter Thread starter ASidebottomIU
  • Start date Start date
  • Tags Tags
    3d Matlab Plot
Click For Summary

Discussion Overview

The discussion revolves around creating a 3D scatter plot in Matlab, specifically focusing on importing data from an Excel file and understanding the parameters required for the scatter3 function. Participants explore how to replicate a specific figure from a scientific paper.

Discussion Character

  • Homework-related
  • Technical explanation

Main Points Raised

  • Ashley seeks assistance with importing x, y, z data from an Excel file for a 3D plot in Matlab.
  • One participant suggests investigating the function xlsread and provides a command to access its help documentation.
  • Ashley expresses confusion about the additional parameters 's' and 'c' required for the scatter3 function, indicating a need for a step-by-step guide.
  • Another participant explains that 's' may set the size of the dots and 'c' may set the color of the points, and suggests consulting Matlab documentation for further learning.
  • This participant also notes that scatter3 may not produce plots resembling the figures referenced by Ashley and recommends using surface or scatter functions instead for different plot types.
  • Ashley acknowledges the help received and indicates that she has figured out the solution.

Areas of Agreement / Disagreement

The discussion includes a mix of questions and suggestions, with no explicit consensus reached on the best approach to replicate the figures. Ashley's final acknowledgment suggests she found a solution, but the details of that solution are not shared.

Contextual Notes

Participants do not clarify the specific requirements or limitations of the data format or the expected output in detail. There is also no resolution on the best method to achieve the desired plot style.

Who May Find This Useful

Individuals new to Matlab, particularly those interested in data visualization and importing data from Excel for scientific applications.

ASidebottomIU
Messages
3
Reaction score
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
investigate the function xlsread

Code:
help xlsread
 
Last edited:
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
 
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 similar. You could use multiple calls to scatter with "hold on;" to plot the different colors or dot sizes.
 
Last edited by a moderator:
Thank you MisterX for your reply- it definitely helped and I have figured it out!
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K