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

  • Thread starter Thread starter ASidebottomIU
  • Start date Start date
  • Tags Tags
    3d Matlab Plot
AI Thread Summary
Ashley from IU Chemistry seeks assistance with importing x, y, z data from an Excel file into Matlab for a 3D scatter plot. She is confused about the additional parameters 's' and 'c' needed for the scatter3 function, which control the size and color of the points, respectively. It is noted that scatter3 may not replicate the desired figures from the referenced paper, and alternative functions such as surface or scatter are recommended for achieving similar results. A step-by-step guide is requested to better understand the script in relation to Matlab's GUI. Ultimately, Ashley reports that she has resolved her issue with the help received.
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 similiar. 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
Views
2K
Replies
4
Views
3K
Replies
1
Views
3K
Replies
3
Views
2K
Replies
1
Views
2K
Replies
1
Views
5K
Replies
2
Views
3K
Back
Top