-2

I can create plots of two groups in one window but I don't know how to combine two plots in one frame with same x and y axis lines. The example is as same as the linked image. I would be grateful if someone can help me to do this with R.

Please click here to view the image

  • 2
    More detail needed. What does your data look like and how do you plot it? The boxplot function automatically plots boxes side by side. – Konrad Rudolph Oct 05 '15 at 13:46
  • Please provide what we need to help you through a minimal working example (http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – TARehman Oct 05 '15 at 13:47

2 Answers2

1

Try, using cbind function

boxplot(cbind(boxplot1, boxplot2))

This will display the two boxplots in same frame with combined x and y axes.

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
1

Example:

plot(x,y)
par(new=TRUE)
plot(x,y)