Is this a bug in bar plot

2 ビュー (過去 30 日間)
Durga Lal Shrestha
Durga Lal Shrestha 2020 年 4 月 22 日
コメント済み: dpb 2020 年 4 月 23 日
Something is not right with bar plot when some values are very very high and it is required to limit y values so that other values can be seen.
highValue=10E15;
y = [2 2 3*highValue; 2 5 6*highValue; 2 8 9*highValue; 2 11 12*highValue];
bar(y)
Now I want to limit yvalue so that I can see other values
ylim([0 10])
Now the results is:
No issue when highValue=10E14. Is this a bug in bar plot?
  4 件のコメント
dpb
dpb 2020 年 4 月 22 日
R2014b doesn't go outside the box boundaries but generates the same diagonal slash on the second group...
Adam Danz
Adam Danz 2020 年 4 月 22 日
編集済み: Adam Danz 2020 年 4 月 22 日
Error reproduced in r2020a.

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

回答 (1 件)

Muhammad Usman
Muhammad Usman 2020 年 4 月 22 日
I suggest you to use two additional lines of code
highValue=10E15;
y = [2 2 3*highValue; 2 5 6*highValue; 2 8 9*highValue; 2 11 12*highValue];
bar(y)
set(gca,'YScale','log');
grid on;
  4 件のコメント
Durga Lal Shrestha
Durga Lal Shrestha 2020 年 4 月 22 日
I found this type of issue with plot function as well.
dpb
dpb 2020 年 4 月 23 日
Is there really some mandatory reason to have such a large highvalue value, anyway, in reality?
Doesn't seem realistic use case, somehow...

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by