フィルターのクリア

using bar3(z) to plot in unusual data visualization

1 回表示 (過去 30 日間)
Stephen
Stephen 2024 年 5 月 10 日
コメント済み: Voss 2024 年 5 月 10 日
Can someone help me write the script to plot my data as 3 separate bar charts, each along an X, Y, and Z axes, such as:
(this was created w/ help of Photoshop)

採用された回答

Voss
Voss 2024 年 5 月 10 日
編集済み: Voss 2024 年 5 月 10 日
red_data = [ 5 5 20 35 15];
blue_data = [30 25 20 15 5];
green_data = [30 25 35 5 5];
Nr = numel(red_data);
Nb = numel(blue_data);
Ng = numel(green_data);
data = NaN(Nb+1,Nr+Ng+1);
data(1,1:Nr) = red_data;
data(2:end,Nr+1) = blue_data;
data(1,Nr+2:end) = green_data;
h = bar3(data);
for ii = [1:Nr Nr+2:Nr+Ng+1]
h(ii).ZData(6:end,:) = NaN;
end
h(Nr+1).ZData(1:5,:) = NaN;
set(h(1:Nr),'FaceColor','r')
set(h(Nr+1),'FaceColor','b')
set(h(Nr+2:end),'FaceColor','g')
  7 件のコメント
Stephen
Stephen 2024 年 5 月 10 日
VERY helpful, very clear, very thorough. This is tremendously appreciated, Voss!
Voss
Voss 2024 年 5 月 10 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by