| To: | s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | Re: Grouping barplot, y axis in percent |
| From: | Mario Cortina Borja <M.Cortina@ich.ucl.ac.uk> |
| Date: | Mon, 10 Oct 2005 10:20:47 +0100 |
| Cc: | Patrick.Heer@bakom.admin.ch |
| In-reply-to: | <972231170C40FE4797E048E1E39B22AB1EF87C@sbem35exc1004.efd.i ntra.admin.ch> |
|
Hi Patrick, One solution is as follows: ### suppose data.frame test has columns Sex and Age mat1<- table( test$Sex, test$Age) for(i in 1:2) mat1[i,]<- mat1[i,] / sum(mat1[i,]) barplot( mat1, beside=T, space=c(0,1), density=c(0,0), legend=levels(test$Sex), col=c(1,5)) mtext(levels(test$Age), side=1, line=1, at=seq(2,20, by=3)) title(ylab='% Sex',xlab='Age groups') Best wishes, Mario At 10:33 AM 10/10/2005 +0200, you wrote: Dear all Dr Mario Cortina Borja Senior Lecturer in Statistics M.Cortina@ich.ucl.ac.uk Phone +44(0)20 7905 2113 Fax +44(0)20 7905 2381 Paed. Epid. & Biostats, Institute of Child Health, UCL, London WC1N 1EH, UK |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Grouping barplot, y axis in percent, Patrick.Heer |
|---|---|
| Next by Date: | Working with graphsheets and multiple pages, Thom Burnett |
| Previous by Thread: | Grouping barplot, y axis in percent, Patrick.Heer |
| Next by Thread: | Working with graphsheets and multiple pages, Thom Burnett |
| Indexes: | [Date] [Thread] [Top] [All Lists] |