How to plot multiple data sets on bar3
10 ビュー (過去 30 日間)
古いコメントを表示
I’m trying to make multiple 3D histogram plots side-by-side. I think I need to use the bar3 function, but I don’t know what combination of code to use. Am I trying to make something that doesn’t exist in MATLAB?
2 件のコメント
dpb
12分 前
Can you sketch what you envision this should look like or show a published example?
bar3 is quite limited in its flexibility to modify and there are no other builtin functions with additional abilities beyond it.
回答 (1 件)
dpb
41分 前
移動済み: dpb
41分 前
Oh. That is what bar3 can/does do. Look at the examples; the Z data array would be 3x3 with the x-axis being rows and y the columns.
Z=[1 2 1; 3 3 2; 3 2 3].'; % counts that approximate sketch
hB=bar3(Z); % make base 3D bar
map=[0 0 1; 1 0 0; 0 1 0]; % set colormap to match sketch b,r,g
colormap(map)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!