[R] Fixing scale when plotting

Jean Vidal jean.vidal at freesurf.fr
Mon Feb 4 19:38:39 CET 2002


I would like to plot on the same page - with mfrow=c(2,5) - several 
barplots which describe answers to a question in a survey, ranging from 1 
to 10. Sometimes, values are not present in the dataset (nobody answers "1" 
to question A). To keep the graphs on the same scale, I tried, with little 
succes, to fix the scale, so that a level is represented even if no value 
is present.
With an example :
barplot(table(c(1,2,2,3,4,4,5)))
barplot(table(c(2,2,2,4,4,4,5)))
How to have the second plot on the same scale as the first, ranging from 1 
to 5, with all levels ?

Thanks for your help.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list