Hi Xin,

Or, just try adding "oma" and "mtext" commands:

?par
?mtext

# Code
par(mfcol=c(2,2))
par(oma=c(2,2,0,0))
plot(x <- sort(rnorm(7)), type = "s", main = "", ylab="", xlab="")
plot(x <- sort(rnorm(27)), type = "s", main = "", ylab="", xlab="")
plot(x <- sort(rnorm(47)), type = "s", main = "", ylab="", xlab="")
plot(x <- sort(rnorm(67)), type = "s", main = "", ylab="", xlab="")
mtext("One x-label", side = 1, outer=TRUE)
mtext("One y-label", side = 2, outer=TRUE)

~Gurmeet


On Fri, May 14, 2010 at 4:14 AM, Jim Lemon <j...@bitwrit.com.au> wrote:

> On 05/14/2010 02:04 AM, Xin Ge wrote:
>
>> Hi All,
>>
>> Can anyone please help me with getting a single x and y-axis label while
>> plotting muliple plots. Here is the code:
>>
>> par(mfcol=c(2,2))
>> plot(x<- sort(rnorm(7)), type = "s", main = "", ylab="", xlab="")
>> plot(x<- sort(rnorm(27)), type = "s", main = "", ylab="", xlab="")
>> plot(x<- sort(rnorm(47)), type = "s", main = "", ylab="", xlab="")
>> plot(x<- sort(rnorm(67)), type = "s", main = "", ylab="", xlab="")
>>
>> also, how can remove x-tick lables using plot()?
>>
>>  Hi Xin,
> Fortunately, this wheel is pretty easy to reinvent:
>
> require(plotrix)
>
> x1<-rnorm(7)
> x2<-rnorm(27)
> x3<-rnorm(47)
> x4<-rnorm(67)
> allxlim<-c(1,67)
> allylim<-range(c(x1,x2,x3,x4))
> panes(matrix(1:4,nrow=2,byrow=TRUE),widths=c(1.1,1),
>  heights=c(1,1.1))
> par(mar=c(0,4,2,0))
> plot(sort(x1),xlim=allxlim,ylim=allylim,type="s",
>  main="",ylab="",xlab="",xaxt="n")
> tab.title("Plot of x1",tab.col="orange")
> par(mar=c(0,0,2,1))
> plot(sort(x2),xlim=allxlim,ylim=allylim,type="s",
>  main="",ylab="",xlab="",xaxt="n",yaxt="n")
> tab.title("Plot of x2",tab.col="orange")
> par(mar=c(4,4,2,0))
> plot(sort(x3),xlim=allxlim,ylim=allylim,type="s",
>  main="",ylab="",xlab="")
> tab.title("Plot of x3",tab.col="orange")
> par(mar=c(4,0,2,1))
> plot(sort(x4),xlim=allxlim,ylim=allylim,type="s",
>  main="",ylab="",xlab="",yaxt="n")
> tab.title("Plot of x4",tab.col="orange")
>
> Jim
>
>
> ______________________________________________
> R-help@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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to