how to increasse Bar3 plot bar thickness in both axies

1 次查看(过去 30 天)
i am useing this code for combined my drive cycle with value of 30*80
and at the reult i got slim bar plot as output and i want to incresse thickness of bar in both axis so at the end it will look like a Bar.
i am send you my code if any have suggestion regarding this:
dp_ax=5:10:800;
vfl_ax=0.5:1:30;
figure
width=0.1;
h=bar3(vfl_ax,Data_combined);
Xdat=get(h,'XData');
title('EWP operating profile for combined drive cycle')
xlabel('Pressure diffrance [mbar]')
ylabel('Volume flow rate [L/min]')
axis tight
for ii=1:length(Xdat)
Xdat{ii}=dp_ax(ii)*ones(size(Xdat{ii}));
set(h(ii),'XData',Xdat{ii});
end

回答(2 个)

Cris LaPierre
Cris LaPierre 2021-5-3
You could try using the 'Width' name value pair (see this example), but I think the bigger issue is the scale of your X vs Y axes. Pressure (Y) ranges fro 0-800 while Volume (X) ranges from 0-30. Each bar can have a maximum with of 1, which corresponds to the width of a unit increase in the corresponding X or Y axis. A unit step in X is much bigger than a unit step in Y. This is causing your bars to look skinny.
It appears your bars are all space 10 units apart in Y. Perhaps you can divide your Y values by 10 so the bars will all be spaced 1 unit apart instead?

Alon Slapak
Alon Slapak 2023-9-30
ax = gca;
ax.PlotBoxAspectRatio = [1 0.5 1];

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by