3D scatterplot with marker color as a function of fourth variable
27 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Toby Feld
el 7 de Mayo de 2021
Comentada: Toby Feld
el 7 de Mayo de 2021
Hello,
I would like to make a scatterplot with the variables x, y, and z. The color of the marker should be determined by the value of variable a.
What's the best way to do that?
Cheers,
Tim
1 comentario
Scott MacKenzie
el 7 de Mayo de 2021
How does the 4th variable (a) map onto the other three (x, y, z)?
Respuesta aceptada
Scott MacKenzie
el 7 de Mayo de 2021
Editada: Scott MacKenzie
el 7 de Mayo de 2021
Assuming you want a separate color for each point...
x = rand(1,100);
y = rand(1,100);
z = rand(1,100);
a = 1:100;
scatter3(x,y,z,50,a,'filled');
colorbar;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/610765/image.jpeg)
Más respuestas (0)
Ver también
Categorías
Más información sobre Discrete Data Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!