How to change distance of xticks in 3d bar plot (using bar3) ?

9 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Voss
Voss il 29 Mag 2022
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×3
2.8000 25.0000 15.4508
pbar(1) = 10;
set(gca(),'PlotBoxAspectRatio',pbar)
Or maybe this?
figure;
h=bar3(dat,0.4); % bar width = 0.4
set(gca(),'PlotBoxAspectRatio',pbar)

Più risposte (0)

Categorie

Scopri di più su Discrete Data Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by