How to change distance of xticks in 3d bar plot (using bar3) ?
9 次查看(过去 30 天)
显示 更早的评论
Hi, I'm trying to draw multiple 3d bar plots in a single figure.
I used 'bar3', as below, but the result is quite unsatisfying.
july_mean = 20 + (50-20).*rand(24,1);
june_mean = 20 + (50-20).*rand(24,1);
may_mean = 20 + (50-20).*rand(24,1);
dat = [may_mean,june_mean,july_mean];
figure; h=bar3(dat);
I want to widen the distance between xticks 1,2,3 so that 3 barplots seem well saparated.
How can I do that?
0 个评论
采纳的回答
Voss
2022-5-29
july_mean = 20 + (50-20).*rand(24,1);
june_mean = 20 + (50-20).*rand(24,1);
may_mean = 20 + (50-20).*rand(24,1);
dat = [may_mean,june_mean,july_mean];
How about this?
figure;
h=bar3(dat);
axis square
Or this?
figure;
h=bar3(dat);
pbar = get(gca(),'PlotBoxAspectRatio')
pbar(1) = 10;
set(gca(),'PlotBoxAspectRatio',pbar)
Or maybe this?
figure;
h=bar3(dat,0.4); % bar width = 0.4
set(gca(),'PlotBoxAspectRatio',pbar)
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!