4 variables in 3d plot

7 ビュー (過去 30 日間)
fhfghfg
fhfghfg 2023 年 1 月 11 日
コメント済み: Cris LaPierre 2023 年 1 月 12 日
I have 4 variables that I want to put od 3d scatter plot. X and Y are namig the concentration of tested substances while Z and C are the measured values of these substances, respectively.
I would like to present this data as in this picture. Refering to the photo blood pressure would be the value in the bracket, while Z and C would be "smoker" and "non-smoker" https://ch.mathworks.com/help/examples/matlab/win64/Visualizing4DExample_01.png
x = [15 25 50 15 15 15 25 25 25 50 50 50 0 0 0];
y = [0 0 0 25 50 75 25 50 75 25 50 75 25 50 75];
z = [53457 75132 111904 31863 86505 56549 75240 116996 99230 180657 171960 140200 188 322 121];
c = [14 12 10 355 1561 1212 473 845 1222 594 619 771 484 1064 1290];

採用された回答

Cris LaPierre
Cris LaPierre 2023 年 1 月 11 日
The linked figure appears to have been created with stem3.
x = [15 25 50 15 15 15 25 25 25 50 50 50 0 0 0];
y = [0 0 0 25 50 75 25 50 75 25 50 75 25 50 75];
z = [53457 75132 111904 31863 86505 56549 75240 116996 99230 180657 171960 140200 188 322 121];
c = [14 12 10 355 1561 1212 473 845 1222 594 619 771 484 1064 1290];
stem3(x,y,z)
hold on
stem3(x,y,c)
hold off
  2 件のコメント
fhfghfg
fhfghfg 2023 年 1 月 12 日
Thank you for the anserw and help ! How can I get rid of the vertical lines?
Cris LaPierre
Cris LaPierre 2023 年 1 月 12 日
The vertical lines are there because it is a stem plot. If you would rather just have the markers, use scatter3.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by