3D scatterplot with marker color as a function of fourth variable

85 views (last 30 days)
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?

Accepted Answer

Scott MacKenzie
Scott MacKenzie on 7 May 2021
Edited: Scott MacKenzie on 7 May 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;

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by