=?gb2312?B?tPC4tDogW1JdIEhvdyB0byBkcmF3IHgtYXhpcyB0aW1lIGxhYmVsLg==?=

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Oct 22 09:06:58 CEST 2004


On Fri, 22 Oct 2004, Ivy_Li wrote:

> Thank you for helping me.
> I have modified this part of code.
> 
> Time <- c("2004-08-05 09:08:48", "2004-08-13 20:53:38",
>   	"2004-08-14 13:57:23", "2004-08-12 16:17:41", 
>   	"2004-08-12 16:15:27", "2004-08-11 21:38:24",
>   	"2004-08-12 14:28:41", "2004-08-18 18:04:47",
>   	"2004-08-13 15:23:14", "2004-08-14 02:36:33")
> Time <- as.POSIXct(Time)
> x <- data.frame(main.name="AAA", fruit.name=rep(c("Apply","Watermelon"),each=5), 
> 		x.name=Time, y.name=(1:10))
> par(las=3,mai=c(1,.7,.5,.3))
> plot(x$x.name,as.character(x$y.name),pch=26, xlab="Process Time", xaxt = 'n')
> axis.POSIXct(1, at=seq(min(x$x.name), max(x$x.name), "days"),format="%d /%m")
> fruit.class <- table(x$fruit.name)
> color.code <- c(611,552,656,121,451,481,28,652,32,550,90,401,150,12,520,8)
> for(j in 1:length(fruit.class))
> {
> 	fruit <- names(fruit.class)[j]
> 	lines(smooth.spline(x[x$fruit.name==fruit, "x.name"],
> 		x[x$fruit.name==fruit, "y.name"],df=5),
> 		col=colors()[color.code[j]],lwd=5)
> }
> 
> Run above code , you will find the "Process Time" is close to the
> x-label, I want to move it down . And How can I reduce font? Thank you

"Process Time" *is* the x-label!  You will find all this discussed in "An
Introduction to R": you need to change the margins and to use title(xlab=,
line=) to place the x-label in another position.  And the font *size* is
set by cex*: see ?par and the "An Introduction to R" manual.

[Many, many unneeded lines removed.]


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list