[R] superposing barplots having different scales

From: Bill Shipley <bill.shipley_at_usherbrooke.ca>
Date: Wed, 28 May 2008 11:42:20 -0400


Hello. I know how to make a bar plot in which a numeric y variable is plotted against some grouping variable X (say, groups A, B, C) when this grouping variable is subdivided into each of two subgroups; so the bars would be: (group A subgroup 1) beside (group A subgroup 2), then (group B subgroup 1) beside (group B subgroup 2), and so on. This is done using the beside=TRUE argument in the barplot() function. However, I want to make a slightly different type of barplot in which the numerical values of the subgroups (subgroups 1 and 2) are measured in very different scales. I want to use different scales to define the numerical y values for each subgroup. This graph would have one scale on the left-hand y-axis and a second scale on the right-hand y-axis.

I cannot simply superimpose two bar plots because I have to make sure that the subgroup bars are beside each other.  

Bill Shipley

North American Editor, Annals of Botany

Département de biologie

Université de Sherbrooke

Sherbrooke (Québec) J1K 2R1

Canada

(819) 821-8000, poste 62079

(819) 821-8049 FAX
   <http://pages.usherbrooke.ca/jshipley/recherche/> http://pages.usherbrooke.ca/jshipley/recherche/  

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 28 May 2008 - 17:37:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 28 May 2008 - 21:30:57 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive