Re: [R] horizontal yaxis label

From: Chuck Cleland <ccleland_at_optonline.net>
Date: Tue 27 Jun 2006 - 21:34:18 EST

Marc Bernard wrote:
> Dear all,
>
> I wonder how to get an horizontal label for the y axis in the plot function. I have looked at par and many function but didn't find it.
> more specifically , let:
>
> df <- data.frame(cbind(1:10, 11:20))
> names(df) <- c("y","x")
>
> plot(y ~ x, data = df, ylab = "dependent")
>
> how to ask R to have the label "independent" in an horizontal form?

   I think you want something like this:

df <- data.frame(cbind(1:10, 11:20))
names(df) <- c("y","x")

par(mar = c(7, 10, 7, 7))
plot(y ~ x, data = df, ylab = "", xlab = "independent") text(par("usr")[1] - 1, 5.5, adj = 1, labels = "dependent", xpd = TRUE)

   Adapted from the example in section 7.27 of http://cran.r-project.org/doc/FAQ/R-FAQ.html

> I have another question concerning the xyplot:
>
> Suppose that I have made an xyplot with 4 panels defined by one factor variable. How may I have a blank space between the four panels?

   See the between argument. For example:

library(lattice)

df2 <- data.frame(Y = runif(20), X = rnorm(20), G = rep(c("A","B","C","D"), each=5))

xyplot(Y ~ X | G, data = df2, layout=c(2,2), between=list(x=1,y=1))

> Thank you,
>
> Bernard,
>
>
>
>
>
>
> ---------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jun 27 22:50:38 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 28 Jun 2006 - 00:12:05 EST.

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