how to increasse Bar3 plot bar thickness in both axies

1 回表示 (過去 30 日間)
Mitulkumar Vasani
Mitulkumar Vasani 2021 年 5 月 2 日
コメント済み: Dyuman Joshi 2023 年 9 月 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];
  1 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 9 月 30 日
This does not do what OP wants to do.

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by