[R] Remove spacing at the top and bottom of a plot
AbouEl-Makarim Aboueissa
abouelmakarim1962 at gmail.com
Sun Sep 24 22:58:38 CEST 2017
Dear All:
Is there is away to remove spacing at the top and the bottom of a plot? If
so, any help will be appreciated.
Please use this code as an example:
par(mfrow=c(1,2))
lizard <- c(6.2, 6.6, 7.1, 7.4, 7.6, 7.9, 8, 8.3, 8.4, 8.5, 8.6,8.8, 8.8,
9.1, 9.2, 9.4, 9.4, 9.7, 9.9, 10.2, 10.4, 10.8,11.3, 11.9)
n.draw <- 100
mu <- 9
n <- 24
SD <- sd(lizard)
draws <- matrix(rnorm(n.draw * n, mu, SD), n)
get.conf.int <- function(x) {
t.test(x)$conf.int
}
conf.int <- apply(draws, 2, get.conf.int)
plot(range(conf.int), c(0, 1 + n.draw), type = "n", xlab = "mean tail
length", ylab = "sample run")
for (i in 1:n.draw) {
if(conf.int[1,i] <= mu & conf.int[2,i] >= mu ){
#### lines(conf.int[, i], rep(i, 2), lwd = 2, col = 'green')
lines(conf.int[, i], rep(i, 2), lwd = 2)
}
else {
lines(conf.int[, i], rep(i, 2), lwd = 2, col = 'red')
}
}
abline(v = 9, lwd = 3, col='blue') #### lty = 2,
Thank you very much for your help.
with many thanks
abou
______________________
AbouEl-Makarim Aboueissa, PhD
Professor of Statistics
Department of Mathematics and Statistics
University of Southern Maine
[[alternative HTML version deleted]]
More information about the R-help
mailing list