Using CData and 'Filled' with Scatter3
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Walter Roberson
am 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() ?
Antworten (0)
Siehe auch
Kategorien
Mehr zu Scatter Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!