Using CData and 'Filled' with Scatter3

조회 수: 18 (최근 30일)
Matt Thornton
Matt Thornton 2012년 7월 5일
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
Walter Roberson
Walter Roberson 2012년 7월 6일
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() ?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by