Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Automatically position annotation on bar graph
Date: Thu, 18 Jun 2009 20:15:04 +0000 (UTC)
Organization: The University of Warwick
Lines: 22
Message-ID: <h1e788$bsp$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245356104 12185 172.30.248.38 (18 Jun 2009 20:15:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 18 Jun 2009 20:15:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 658987
Xref: news.mathworks.com comp.soft-sys.matlab:548741


I could to with some help.
I have created a function which creates a number of subplots based on a user selection.  
The subplots are bar graphs. 
The y axis is normalised data.  
The x-axis is is the observations. 
I would like to place a text box with the absolute vaue on top of each bar graph.

Because the bar gaphs are varying height I don't know how to calculate the position of the textbox.  Once the position is calculate how do code the reference to the absolute value to put in the text box?
Below is the code to generate the subplots.

for i=1:NPlotsWanted

    subplot(x,y,i),bar(cell2mat(store(2:end-1,ave_index(i)+1))); 
    xlabel('Month','fontsize',8);
    ylabel('Normalised DTC count per month','fontsize',8);
    axis([0 noOfDatas+1 0 0.05]);
    legend(store(1,ave_index(i)+1),'location','NorthOutside','FontSize',8); 
    set(gca,'XTickLabel', months); % labels Xticks with months.

end

Thanks, Gunny