[R] several common sub-axes within multiple plot area

Karl Brand k.brand at erasmusmc.nl
Sat Jun 26 15:20:52 CEST 2010


Dear List,

I'd really appreciate tip's or code demonstrating how i can achieve some 
common axis labels integrated into a multiple plot.

In my example (below), i'm trying to achieve:

-a single "Results 1 (Int)" centered & btwn row 1 and row 2;
-a single "Results 2 (Int)" centered & btwn row 2 and row 3;  and,
-a single "Results 3 (Int)" centered at the bottom, ie., below row 3.

I played with mtext() and par(oma=... per this post-

https://stat.ethz.ch/pipermail/r-help/2004-October/059453.html

But have so far failed to achieve my goal. Can i succeed with something 
combined with the 'high level' plot() function? Or do i need to get 
specific with some low level commands (help!)?

With big thanks in advance for any suggestions/examples.

cheers,

Karl

#my example:
dev.new()
plot.new()
par(mfrow=c(3,2))
#Graph 1:
plot(rnorm(20), rnorm(20),
      xlab = "Results 1 (Int)",
      ylab = "Variable A",
      main = "Factor X")
#Graph 2:
plot(rnorm(20), rnorm(20),
      xlab = "Results 1 (Int)",
      ylab = "Variable A",
      main = "Factor Y")
#Graph 3:
plot(rnorm(20), rnorm(20),
      xlab = "Results 2 (Int)",
      ylab = "Variable B")
#Graph 4:
plot(rnorm(20), rnorm(20),
      xlab = "Results 2 (Int)",
      ylab = "Variable B")
#Graph 5:
plot(rnorm(20), rnorm(20),
      xlab = "Results 3 (Int)",
      ylab = "Variable C")
#Graph 6:
plot(rnorm(20), rnorm(20),
      xlab = "Results 3 (Int)",
      ylab = "Variable C")


-- 
Karl Brand
Department of Genetics
Erasmus MC
Dr Molewaterplein 50
3015 GE Rotterdam
T +31 (0)10 704 3457 |F +31 (0)10 704 4743 |M +31 (0)642 777 268



More information about the R-help mailing list