Hi
In the following code:
How can I show each bar its value
clc, cleary = [2 2 3; 2 5 6; 2 8 9; 2 11 12];bar(y)for i=1:1:length(y) text(i:i,y(i)',num2str(y(i)' ,'%0.2f')),'HorizontalAlignment','center','VerticalAlignment','bottom'; box off ;end
I will note that I have the 2019 version that does not support the above solution
TNX 🙂
xtips1 = b(1).XEndPoints;ytips1 = b(1).YEndPoints;labels1 = string(b(1).YData);text(xtips1,ytips1,labels1,'HorizontalAlignment','center',... 'VerticalAlignment','bottom')
Best Answer