Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab 3D Scatter Plot

  1. Jul 16, 2011 #1

    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:


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

    IU Chemistry
  2. jcsd
  3. Jul 17, 2011 #2
    investigate the function xlsread

    Code (Text):
    help xlsread
    Last edited: Jul 17, 2011
  4. Jul 17, 2011 #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.

  5. Jul 17, 2011 #4
    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: Apr 26, 2017
  6. Aug 2, 2011 #5
    Thank you MisterX for your reply- it definitely helped and I have figured it out!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook