MATLAB: Display values in bar plot (app designer)

app designerbar plot

I have a problem with the code,
Why do I not see values ​​in a graph like in Figure
Notice the yellow in the picture
X = categorical({'Small','Medium','Large'});
X = reordercats(X,{'Small','Medium','Large'});
Y = [2 3 6];
bar(X,Y);
b = bar(app.UIAxes,X,Y);
for i=1:1:length(X)
text(i:i,Y(i)',num2str(Y(i)','%0.2f'),'HorizontalAlignment','center','VerticalAlignment','bottom')
box off
end

Best Answer

Pass app.UIAxes as first argument of text()
text(app.UIAxes, i:i, Y(i)', num2str(Y(i)','%0.2f'),'HorizontalAlignment','center','VerticalAlignment','bottom')