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
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 9K views
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!