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

77 ビュー (過去 30 日間)
Toby Feld
Toby Feld 2021 年 5 月 7 日
コメント済み: Toby Feld 2021 年 5 月 7 日
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 件のコメント
Scott MacKenzie
Scott MacKenzie 2021 年 5 月 7 日
How does the 4th variable (a) map onto the other three (x, y, z)?

サインインしてコメントする。

採用された回答

Scott MacKenzie
Scott MacKenzie 2021 年 5 月 7 日
編集済み: Scott MacKenzie 2021 年 5 月 7 日
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;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by