I would like to display the p-values on top of a bar graph.
Here's what I have:
y = [1 2 3; 4, 4, 5; 6, 7, 6]; p = rand(3,3) figure bar(y) p_flat = reshape(p', 1, 9); y_flat = reshape(y', 1, 9); for ii = 1:9 text(ii, p_flat(ii)+2, ['p=' num2str(p_flat(ii))]) end
The problem is that only three p-values are being displayed, and they are in the wrong spot.
How do I make it so that the p-values are on top of the correct bar?
Thanks!
Best Answer