[R] boxplot with 2 treatments and 2 variables (with 2 corresponding y-axes)

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Apr 17 19:39:12 CEST 2011



On 15.04.2011 16:20, Ellis, David wrote:
> Hi,
>
> I am a complete newcomer to R and although I can plot standard box-plots I am struggling with this...
>
> I have two treatments - A&  B, and 2 variables 1&  2. I want to compare boxplots of variable 1 with variable 2 for each treatment. I would also like them to all be on the same graphic.
>
> I would like treatment to be on the x axis (A and B) and above A and B have their corresponding boxplots for both variables.I would also like 2 seperate y-axes, one for each variable - Variable 1 has a continuous y axis, and variable 2 is a percentage (of variable 1 in-fact, not that this should make a difference).
>
> It would also be helpful if the boxplots were a different colour for each variable and that this corresponded somehow to the relevant axis. Or if someone can think of another way to show which treatment each boxplot is that would be gratefully recieved
>
> Hope this makes sense and isn't too much of a pain to answer!

Not sure if it makes sense:
If you have two boxplots beside each other, you tend to compare them 
directly. If they are unrelated (different variables with different 
scaling as in this case), I'd be careful not to confuse the reader of 
the plot ....

Best,
Uwe Ligges



> Thanks in advance
> Dave
>
>
> 	[[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.



More information about the R-help mailing list