Dear All, I am trying to plot four diagnostic plots for my lm in one window. Here is some random data for an example: a = rnorm(20, mean=2, sd=0.2) b = rnorm(20, mean=1, sd=0.4) model=lm(a~b) When I set the page as: par(mfrow=c(1,1), oma=c(1,0,2,0)) and plot my model: plot(model) above all four plots the formula lm(a~b) is printed. What is interesting if I set the page to have two plots per page (still plotting all four using plot(model)), the formula is plotted only above the last two. When I set the page to have one plot per page (still plotting all four using plot(model)) the formula is not printed above any of the plots. Is there any way to control plotting the formula above the diagnostic plots if I have multiple per page? To control the text size, font, position, or just not to have it plotted it at all? Playing with the option 'main' or 'cex.main' inside the 'plot' function does not change anything. Many thanks Kasia -- View this message in context: http://r.789695.n4.nabble.com/How-to-control-plotting-formula-above-lm-diagnostic-plots-tp4650465.html Sent from the R help mailing list archive at Nabble.com.
Uwe Ligges
2012-Nov-25 17:57 UTC
[R] How to control plotting formula above lm diagnostic plots?
On 22.11.2012 18:58, ksaw wrote:> Dear All, > > I am trying to plot four diagnostic plots for my lm in one window. > > Here is some random data for an example: > a = rnorm(20, mean=2, sd=0.2) > b = rnorm(20, mean=1, sd=0.4) > model=lm(a~b) > > When I set the page as: > par(mfrow=c(1,1), oma=c(1,0,2,0)) > and plot my model: > plot(model) > > above all four plots the formula lm(a~b) is printed. > > What is interesting if I set the page to have two plots per page (still > plotting all four using plot(model)), the formula is plotted only above the > last two. When I set the page to have one plot per page (still plotting all > four using plot(model)) the formula is not printed above any of the plots. > > Is there any way to control plotting the formula above the diagnostic plots > if I have multiple per page? To control the text size, font, position, or > just not to have it plotted it at all? Playing with the option 'main' or > 'cex.main' inside the 'plot' function does not change anything.See ?plot.lm and its argument "sub.caption". Uwe Ligges> Many thanks > > Kasia > > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/How-to-control-plotting-formula-above-lm-diagnostic-plots-tp4650465.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >