Use scatter3d to plot large dataset with 7 colors
Ältere Kommentare anzeigen
I have a dataset of about 1500 observations with three numerical variables X, Y, Z, plus a variable C assigning one of seven colors to each observation. How do I use scatter3d to get the corresponding graph (where each observation gets the color as specified in C)? I find many examples/posts for scatter3d on mathworks, but they all involve just a slightly different problem.
Akzeptierte Antwort
Weitere Antworten (1)
Ferheen Ayaz
am 15 Aug. 2020
I suggest to use surf or mesh instead of scatter 3d and colorbar for setting seven colors.
surf(X,Y,Z);
h=colorbar('Ticks',C);
3 Kommentare
B de Bruin
am 15 Aug. 2020
Ferheen Ayaz
am 15 Aug. 2020
I am not sure if it can be applied to your problem, but I have used the following before using surf
[X,Y,Z] = meshgrid(x,y,z)
B de Bruin
am 15 Aug. 2020
Kategorien
Mehr zu Read, Write, and Modify Image finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!