Using CData and 'Filled' with Scatter3

9 views (last 30 days)
Matt Thornton
Matt Thornton on 5 Jul 2012
Hello,
I have a newbie question. I need to make some 3D scatter plots and I am importing the data from MS excel. I am using the CData option to color data points by their Z value and this works very well, I just can't figure out how to display the data points filled with their color. Any help is greatly appreciated.
Here is the code:
if true
%%Define data
figure
[x,y,z] = sphere(16);
x=xlsread('BMP2.xls', 1, 'I2:I1003');
y=xlsread('BMP2.xls', 1, 'K2:K1003');
z=xlsread('BMP2.xls', 1, 'G2:G1003');
scatter3(x(:),y(:),z(:),'CData',z(:))
colorbar
end
TIA
Matt
  1 Comment
Walter Roberson
Walter Roberson on 6 Jul 2012
Why are you assigning values to x, y, z as the output of sphere(), and then overwriting those values as xlread() outputs ?
Have you tried passing the 'filled' option to scatter3() ?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!