Is this a bug in bar plot
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286528/image.bmp)
Now I want to limit yvalue so that I can see other values
ylim([0 10])
Now the results is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286529/image.bmp)
No issue when highValue=10E14. Is this a bug in bar plot?
4 Kommentare
dpb
am 22 Apr. 2020
R2014b doesn't go outside the box boundaries but generates the same diagonal slash on the second group...
Antworten (1)
Muhammad Usman
am 22 Apr. 2020
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;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286668/image.bmp)
4 Kommentare
dpb
am 23 Apr. 2020
Is there really some mandatory reason to have such a large highvalue value, anyway, in reality?
Doesn't seem realistic use case, somehow...
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!