Mark Na
2009-Jul-28  22:47 UTC
[R] Make my plots bigger and reduce white space around panels?
Hi,
I have made a plot with panels (attached) using R code (below) and I'd like
to increase the size of each panel and decrease the white space, especially
the white space between:
1. rows of panels
2. the top panel and its title (which contains info on r2 and N)
3. each panel and its x label.
I've dug around in the plot help files but can't seem to find how to do
this.
Any help much appreciated, thanks!
Mark Na
#####ELEPHANT SPECIES RICHNESS
par(mfrow=c(3,4),oma=c(0,0,2,0))
models<-list(data$SR.elephant.obs~data$AREA,
             log(data$SR.elephant.obs+1,10)~log(data$AREA,10),
             data$SR.elephant.obs~log(data$AREA,10),
             log(data$SR.elephant.obs+1,10)~data$AREA)
for (i in 1:length(models)){ #SCATTERPLOT
model<-lm(models[[i]])
plot(models[[i]],ylab="Elephant SR");
abline(model);title(main=paste("r2=",round(summary(model)$r.squared,digits=3),",
N=",dim(data)[1]))
}
for (i in 1:length(models)){#RESIDUALS VS FITTED VALUES PLOT
model<-lm(models[[i]])
plot.lm(model,which=1,sub.caption=NA)
}
for (i in 1:length(models)){#Q-Q PLOT
model<-lm(models[[i]])
plot.lm(model,which=2,sub.caption=NA)
}
title(main="ELEPHANT SPECIES RICHNESS",outer=TRUE);
savePlot("SR_elephant.emf",type="emf"); dev.off()
	[[alternative HTML version deleted]]
Mark Na
2009-Jul-28  22:53 UTC
[R] Make my plots bigger and reduce white space around panels?
The plot is attached this time... On Tue, Jul 28, 2009 at 4:47 PM, Mark Na <mtb954 at gmail.com> wrote:> Hi, > > I have made a plot with panels (attached) using R code (below) and I'd like > to increase the size of each panel and decrease the white space, especially > the white space between: > > 1. rows of panels > 2. the top panel and its title (which contains info on r2 and N) > 3. each panel and its x label. > > I've dug around in the plot help files but can't seem to find how to do > this. > > Any help much appreciated, thanks! > > Mark Na > > > > > #####ELEPHANT SPECIES RICHNESS > par(mfrow=c(3,4),oma=c(0,0,2,0)) > models<-list(data$SR.elephant.obs~data$AREA, > log(data$SR.elephant.obs+1,10)~log(data$AREA,10), > data$SR.elephant.obs~log(data$AREA,10), > log(data$SR.elephant.obs+1,10)~data$AREA) > for (i in 1:length(models)){ #SCATTERPLOT > model<-lm(models[[i]]) > plot(models[[i]],ylab="Elephant SR"); > abline(model);title(main=paste("r2=",round(summary(model)$r.squared,digits=3),", > N=",dim(data)[1])) > } > for (i in 1:length(models)){#RESIDUALS VS FITTED VALUES PLOT > model<-lm(models[[i]]) > plot.lm(model,which=1,sub.caption=NA) > } > for (i in 1:length(models)){#Q-Q PLOT > model<-lm(models[[i]]) > plot.lm(model,which=2,sub.caption=NA) > } > title(main="ELEPHANT SPECIES RICHNESS",outer=TRUE); > savePlot("SR_elephant.emf",type="emf"); dev.off() >-- Mark Na University of Saskatchewan Saskatoon, Canada