Hi Jim,

Thank you for the help. Along with the bars I wanted to show the respective
percentage as well. Is that possible ?

Regards,
Nataraju
GM

On Fri, Apr 24, 2009 at 4:38 PM, Jim Lemon <jim@bitwrit.com.au> wrote:

> Nattu wrote:
>
>> Hi,
>>
>> I have a query regarding barplot
>>
>> I have a following data
>>
>>                         AIS LEvel
>>                         1              2            3
>> body region    A  10          15           20
>>                     B  15          25          15
>>
>> Now I want to plot a barplot and in each bar (corresponding a body
>> region),
>> I need a percentage of AIS level 1 displayed in the plot. Is there an easy
>> way to do this ?
>>
>> Thanks,
>> Nataraju
>> GM
>>
>>
>>
> Hi Nataraju,
> I might not understand exactly what you want, but try this:
>
> bardat<-matrix(c(10,15,15,25,20,15),nrow=2)
> barpos<-barplot(bardat,beside=TRUE)
> library(plotrix)
> boxed.labels(barpos,bardat/2,bardat/(sum(bardat[,1]/100)))
>
> Jim
>
>


-- 
"No relationship is Static .. You either Step up or Step down"

	[[alternative HTML version deleted]]


