So I've managed to get the value to show on the plot, but it is only over the middle plot. I would like to get the values to show up over their respective bars. I think I need to get the x-coordinates for each bar but am not quite sure about how to do that. Any help would be much appreciated. Here's my code:
x=[1:3]';y=round(rand(3,5)*10);bar(x,y)[size_x,size_y]=size(y);for i1=1:size_x for j1=1:size_y text(x(i1),y(i1,j1),num2str(y(i1,j1),'%0.2f'),... 'HorizontalAlignment','center',... 'VerticalAlignment','bottom') endend
Best Answer