[R] boxplot and xlim confusion?

From: Karin Lagesen <karin.lagesen_at_medisin.uio.no>
Date: Wed 28 Sep 2005 - 23:50:06 EST

I have some code as shown below. Basically, I would like three boxplots to be set next to each other with no ylabels on the two "inner" plots, and I want the same x axis range on all three. However, it seems like boxplot does not respect the xlim setting. I've tried the various ways I thought would work (par, boxplot(...xlim=)) but none of them seem to work. I then tried plot.window, that did not work.

I also have another curious question for you. With the code below I tried to call plot.new and then plot.window before each new plot. What happens then is that the first figure goes on one page whereas the two others get put on the next page with a nice big gap in the middle. Does any of you have an explanation for that?

names <- c(

"LSU>, stop",

">LSU, start",
"SSU>, stop",
">SSU, start",
"TSU>, stop",

">TSU, start")

elsustop <- read.table("28s.euk.accuracy.stop.dev")

[skipped lots of read.table, which just reads files with one number on each line]

par(mfcol=c(1,3))
par(mai = c(0,0,0.5,0.2), omi = c(1,1,1,1))

xaxis = c(-6000,1000)
yaxis = c(0,7)
#plot.new()

#plot.window(xlim=xaxis, ylim=yaxis)
boxplot(alsustop$V1 ,alsustart$V1 ,assustop$V1 ,alsustart$V1 ,atsustop$V1 ,atsustart$V1 ,names=names,col=c("lightblue","orange","lightblue","orange","lightblue","orange") ,horizontal = TRUE, main="ARC", xaxs = "i", las=1) #plot.new()
#plot.window(xlim=xaxis, ylim=yaxis)
boxplot(blsustop$V1 ,blsustart$V1 ,bssustop$V1 ,blsustart$V1 ,btsustop$V1 ,btsustart$V1 ,col=c("lightblue","orange","lightblue","orange","lightblue","orange") ,horizontal = TRUE, main="BAC", xaxs = "i") #plot.new()
#plot.window(xlim=xaxis, ylim=yaxis)
boxplot(elsustop$V1 ,elsustart$V1 ,essustop$V1 ,elsustart$V1 ,etsustop$V1 ,etsustart$V1 ,col=c("lightblue","orange","lightblue","orange","lightblue","orange") ,horizontal = TRUE, main="EUK", xaxs = "i")

Karin (sorry if you're getting sick of me..:))

-- 
Karin Lagesen, PhD student
karin.lagesen@medisin.uio.no
http://www.cmbn.no/rognes/

______________________________________________
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 Thu Sep 29 00:03:03 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:26 EST