[R] offset labeling boxplots

lutz.thieme@amd.com lutz.thieme at amd.com
Fri Jun 7 14:54:21 CEST 2002


Hello everybody,

often I plot boxplots with different number of boxes (up to 200 boxes). 
I'd like to give every box a readable label on the x-axis. Therefore, I 
decrease the fontsize of the names and plot them vertical. 
But if you zoom into the plot (pdf) you will find an offset between the 
tickmark and the label - the label is shifted to the right. 

If you vary the box.count in the following example (without changing
the fontsize) you will find every time this right shifted labels. 
(Finaly, for large box.counts the label will be shifted to the next right 
label!)

Question 1: How can I avoid the right shift of the x-axis label?
Question 2: Is it possible to scale the fontsize depending of the box.count
	 (So that I can read every single label)?


Thank's in advance - regards,

Lutz


#----------------------------
box.count<-150

data(ToothGrowth)
DATA<-list(ToothGrowth$len)
DATA<-rep(DATA,box.count)
box.name<- rep('any text',box.count)

pdf(file='boxplot_test.pdf',width=11,height=8)	
# So I can read every label using the pdf reader zooming functionality.

par(cex.axis=.5)		# make axis font smaller,
par(las=3)		# plot all axis label vertical
b<-boxplot(DATA,plot=FALSE, names=box.name)
bxp(b,show.names=T)

graphics.off()
#----------------------------

platform sparc-sun-solaris2.6
arch     sparc               
os       solaris2.6          
system   sparc, solaris2.6   
status                       
major    1                   
minor    4.1                 
year     2002                
month    01                  
day      30                  
language R  



	Lutz Thieme
	Product Engineering
	AMD - Saxony Manufacturing GmbH
	phone: + 49-351-277 -  4269
	fax:       + 49-351-277-9-4269



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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