3D effect on bar diagram

Is it possible to obtain the 3D effect on bar diagram as shown in the following figure (obtained by Microsoft Excel)?
P.s. I've to plot some scalar quantities.

回答 (1 件)

darova
darova 2020 年 3 月 26 日

1 投票

YOu can manually plot boxes
[X,Y] = meshgrid([0 0 1 1 0]-1/2,[0 0 1 1]-1/2);
Z = zeros(size(X));
Z([6 7 10 11]) = 1;
surf(X,Y,3*Z,'facecolor','r')
hold on
surf(X+1,Y,2*Z,'facecolor','b')
surf(X+2,Y,1*Z,'facecolor','g')
hold off
axis equal

4 件のコメント

Giuseppe
Giuseppe 2020 年 3 月 26 日
Thank you!
darova
darova 2020 年 3 月 26 日
Giuseppe
Giuseppe 2020 年 3 月 26 日
P.s. How can I delete numbers on x axis (i.e. -0.5 0 0.5 1 1.5 2 2.5)?
darova
darova 2020 年 3 月 26 日
axis off
% or
get(gca,'xticklabel',[])

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

カテゴリ

ヘルプ センター および File ExchangeGraphics Objects についてさらに検索

製品

リリース

R2019b

質問済み:

2020 年 3 月 25 日

コメント済み:

2020 年 3 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by