"Unternährer Thomas, uth"
2003-Sep-06 14:28 UTC
[R] split.screen problem and segments in figure margin
hi,
two questions...
1. what happens with points()?
after the split.screen function points() start not at x = 1 (at x = -
something)
graphics.off()
x11()
split.screen(c(3, 1))
split.screen(c(2, 1), 1)
screen(3)
plot(dat, type = "n")
screen(4)
plot(dat, type = "n")
screen(2)
plot(dat, type = "n")
dat <- rnorm(1000)
for (i in 1:length(dat)){
screen(3)
points(i, dat[i])
screen(4)
points(i, dat[i])
screen(2)
points(i, dat[i])
}
close.screen(all = TRUE)
I was searching the mail-archives and found the same question but no answers.
Can somebody help me?
2. Can I draw segments() in the figure margin (not in the plot region).... or
can I split my axis(2,...) in 3 with a gap between them?
thanks for any help
Thomas
Untern?hrer Thomas, uth wrote:> hi, > > two questions... > > 1. what happens with points()? > after the split.screen function points() start not at x = 1 (at x = - something) > > graphics.off() > x11() > split.screen(c(3, 1)) > split.screen(c(2, 1), 1) > > screen(3) > plot(dat, type = "n") > screen(4) > plot(dat, type = "n") > screen(2) > plot(dat, type = "n") > > dat <- rnorm(1000) > > for (i in 1:length(dat)){ > screen(3) > points(i, dat[i]) > screen(4) > points(i, dat[i]) > screen(2) > points(i, dat[i]) > } > > close.screen(all = TRUE) > > I was searching the mail-archives and found the same question but no answers. > Can somebody help me?This is a bug, already submitted as bug report PR#2069. There are a couple of other unfixed bugs related to split.screen(), so I'd recommend to use layout() or par(mfrow = ..) in your case, or even better: consider to contribute a bugfix.> > 2. Can I draw segments() in the figure margin (not in the plot region).... or can I split my axis(2,...) in 3 with a gap between them?You can by setting par(xpd = TRUE). See ?par for details. Uwe Ligges> > thanks for any help > > Thomas > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help