[R] How to change font size?

Nick Kostrov nikolai at eri.u-tokyo.ac.jp
Thu Dec 6 03:18:56 CET 2001


On  5 December 2001 23:28, you wrote:
> On Wed, 5 Dec 2001, Nick Kostrov wrote:
> > Does anybody know how to change the font size of  axis labels in the
> > graphic window? I found that it is possible to change  font to "bold" 
> > but labels are very tiny.
>
> Using some variation on graphics parameter cex, depending if the `axis
> labels' are the numbers or the x/ylab= labels.
>
> However, more likely your device is set up wrongly.  Take a look at
> its parameters, which may include pointsize, for example.
>
> To help more we need to know
>
> 1) the details of your system
I use Linux Slackware 8.0 with X11 Window system and R-1.3.1
> 2) what you used to get the plot
>
> 3) what exactly is the problem.
Actually, I draw the multiple plot and I'd like to put  the axis under the 
bottom of the last one with big labels. Labels are numbers. Here is my code:

"plotizu"<-function(name,tl,ot,to){
t<-"l"
at3<-floor(max(na.exclude(name)))
at1<-ceiling(min(na.exclude(name)))
plot(ot:to,name,main=tl,axes=F,xlab="",ylab="",type=t);
axis(2,at=c(at1,at3),font=2)
}


"plotst2"<-function(izu.stkwz,izu.stkwz.recon,izu.stkwz.recon2){


#
#plotst2(izu.stkwz,izu.stkwz.recon,izu.stkwz.recon2)
#
#postscript('PS/ysd.ps')
#par(mfrow=c(3,1));plot(izu.stkwz$ysd,xlab="ysd original");
#plot(izu.stkwz.recon$ysd,xlab="ysd mb8 
max.level=2");plot(izu.stkwz.recon2$ysd,xlab="ysd mb4 max.level=2" )
#dev.off() 

#t<-"s"
# Raw data
#load('Rdata.la8/izu.stkwz.Rdata')
# Denoised
#load('Rdata2/izu.stkwz.recon2.Rdata')
#plot name
source('plotizu.R')  
# plotizu(nm,title)
#X11(pointsize = 16)
par(mfrow=c(6,1));

#6940 correspons to 1998/12/31
#3654 correspons to 1990/01/01 
ot<-3654
otd<-1990

to<-6940
tod<-1998

#1
nm<-izu.stkwz.recon2$ar2[ot:to]
tl<-"AR2-KWZ"
plotizu(nm,tl,ot,to)
#2
nm<-izu.stkwz.recon2$ara[ot:to]
tl<-"ARA-KWZ"
plotizu(nm,tl,ot,to)
#3
nm<-izu.stkwz.recon2$ik2[ot:to]
tl<-"IK2-KWZ"
plotizu(nm,tl,ot,to)
#4
nm<-izu.stkwz.recon2$kwn[ot:to]
tl<-"KWN-KWZ"
plotizu(nm,tl,ot,to) 
#5
nm<-izu.stkwz.recon2$mk2[ot:to]
tl<-"MK2-KWZ"
plotizu(nm,tl,ot,to)
#6
nm<-izu.stkwz.recon2$mkw[ot:to]
tl<-"MKW-KWZ"
plotizu(nm,tl,ot,to)



#now plot X axis
a<-seq(ISOdate(otd,1,1,tz="GMT"), ISOdate(tod+1,12,31,tz="GMT"),"years")
lla<-length(a);
a<-format(a, format="%Y", tz="GMT") 
#a1<-strptime(as.character(a),format="%m/%Y")

a<-c(1990,"","","","","","","","","","","",1991,"","","","","","","","","","","",1992,"","","","","","","","","","","",1993,"","","","","","","","","","","",1994,"","","","","","","","","","","",1995,"","","","","","","","","","","",1996,"","","","","","","","","","","",1997,"","","","","","","","","","","",1998,"","","","","","","","","","","",1999)
axis(side=1,at=seq(ot,to,by=(to-ot)/(9*12)),labels=a,font=2)
a<-c(1990,1991,1992,1993,1994,1995,1996,1997,1998,1999)
axis(side=1,at=seq(ot,to,by=(to-ot)/9),labels=a,font=2)

}

"plotst3"<-function(izu.stkwz,izu.stkwz.recon,izu.stkwz.recon2){


#
#plotst3(izu.stkwz,izu.stkwz.recon,izu.stkwz.recon2)
#
#postscript('PS/ysd.ps')
#par(mfrow=c(3,1));plot(izu.stkwz$ysd,xlab="ysd original");
#plot(izu.stkwz.recon$ysd,xlab="ysd mb8 
max.level=2");plot(izu.stkwz.recon2$ysd,xlab="ysd mb4 max.level=2" )
#dev.off() 

#t<-"s"
# Raw data
#load('Rdata.la8/izu.stkwz.Rdata')
# Denoised
#load('Rdata2/izu.stkwz.recon2.Rdata')
#plot name
source('plotizu.R')  
# plotizu(nm,title)
#X11(pointsize = 16)
par(mfrow=c(7,1));

#6940 correspons to 1998/12/31
#3654 correspons to 1990/01/01 
ot<-3654
otd<-1990

to<-6940
tod<-1998

#1
nm<-izu.stkwz.recon2$ois[ot:to]
tl<-"OIS-KWZ"
plotizu(nm,tl,ot,to)
#2
nm<-izu.stkwz.recon2$sgh[ot:to]
tl<-"SGH-KWZ"
plotizu(nm,tl,ot,to)
#3
nm<-izu.stkwz.recon2$swg[ot:to]
tl<-"SWG-KWZ"
plotizu(nm,tl,ot,to)
#4
nm<-izu.stkwz.recon2$tgs[ot:to]
tl<-"TGS-KWZ"
plotizu(nm,tl,ot,to) 
#5
nm<-izu.stkwz.recon2$ykw[ot:to]
tl<-"YKW-KWZ"
plotizu(nm,tl,ot,to)
#6
nm<-izu.stkwz.recon2$ysd[ot:to]
tl<-"YSD-KWZ"
plotizu(nm,tl,ot,to)
#7
nm<-izu.stkwz.recon2$ytn[ot:to]
tl<-"YTN-KWZ"
plotizu(nm,tl,ot,to)


#now plot X axis
a<-seq(ISOdate(otd,1,1,tz="GMT"), ISOdate(tod+1,12,31,tz="GMT"),"years")
lla<-length(a);
a<-format(a, format="%Y", tz="GMT") 
#a1<-strptime(as.character(a),format="%m/%Y")

a<-c(1990,"","","","","","","","","","","",1991,"","","","","","","","","","","",1992,"","","","","","","","","","","",1993,"","","","","","","","","","","",1994,"","","","","","","","","","","",1995,"","","","","","","","","","","",1996,"","","","","","","","","","","",1997,"","","","","","","","","","","",1998,"","","","","","","","","","","",1999)
axis(side=1,at=seq(ot,to,by=(to-ot)/(9*12)),labels=a,font=2)
a<-c(1990,1991,1992,1993,1994,1995,1996,1997,1998,1999)
axis(side=1,at=seq(ot,to,by=(to-ot)/9),labels=a,font=2)

}


Thanks,

Nick

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list