help with bar plotting?

1 回表示 (過去 30 日間)
JL555
JL555 2016 年 5 月 19 日
編集済み: Jos (10584) 2016 年 5 月 20 日
y=2.84;
x=0.091713;
a=bar(y,x,1);hold on;
z=3.834;
x=1.011;
s=bar(z,x,1)
i want to plot this in bar graph...which means it should correspond with the value. Any help thanks ! what i get is attached. As u can clearly see that the bars are not depicted well, plus they are attached to each other..i want a gap between them
  6 件のコメント
JL555
JL555 2016 年 5 月 19 日
The two bars aren't suppose to join...i want to separate them a bit
JL555
JL555 2016 年 5 月 19 日
something like this

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

回答 (1 件)

Jos (10584)
Jos (10584) 2016 年 5 月 19 日
編集済み: Jos (10584) 2016 年 5 月 19 日
Plot them in a single statement. Concatenate the X-values and the Y-values to do that:
X = [2.84 3.834];
Y = [0.091713 1.011];
s=bar(X,Y,1)
  2 件のコメント
JL555
JL555 2016 年 5 月 19 日
still getting the same plot
Jos (10584)
Jos (10584) 2016 年 5 月 20 日
編集済み: Jos (10584) 2016 年 5 月 20 日
Did you read the documentation/help of bar?
bar(X,Y,0.8)

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

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by