Re: [R] barplots - text direction

From: David Scott <d.scott_at_auckland.ac.nz>
Date: Wed 24 Aug 2005 - 11:54:50 EST

On Wed, 24 Aug 2005, Murray Pung wrote:

> If the variable names are too long to allow room for each to be displayed on a barplot, how can the direction of the text be changed?
>
> a <- cbind(2.4,2.4,2.5,2.6,2.6,2.6,2.6,2.6,2.9,2.9,2.9)
> b <- cbind(2.3,2.5,2.4,2.2,3.2,2.4,2.9,2.6,2.9,3.0,2.8)
> h <- rbind(a,b)
> colnames(h) <- c("one","two","three","four","five","six","seven","eight","nine","ten","eleven")
> rownames(h) <- c("Pre-stage","Post-stage")
> barplot(h, beside = T, legend = colnames(g), horiz = T, xlim = c(0, 5))
>
>

barplot(h, beside = T, legend = colnames(h), horiz = T, xlim = c(0, 5),

         las=1)

will do it.

Note: colnames(h) not colnames(g)

David Scott


David Scott	Department of Statistics, Tamaki Campus
 		The University of Auckland, PB 92019
 		Auckland	NEW ZEALAND
Phone: +64 9 373 7599 ext 86830		Fax: +64 9 373 7000
Email:	d.scott@auckland.ac.nz


Graduate Officer, Department of Statistics



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 Wed Aug 24 11:59:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:55 EST