View | Details | Raw Unified | Return to bug 17161
Collapse All | Expand All

(-)a/src/library/stats/R/plot.lm.R (-3 / +3 lines)
Lines 302-315 function (x, which = c(1L:3L,5L), ## was which = 1L:4L, Link Here
302
	ymax <- usr[4L]
302
	ymax <- usr[4L]
303
	for(i in seq_along(bval)) {
303
	for(i in seq_along(bval)) {
304
	    bi2 <- bval[i]^2
304
	    bi2 <- bval[i]^2
305
	    if(ymax > bi2*xmax) {
305
	    if(p*ymax > bi2*xmax) {
306
		xi <- xmax + strwidth(" ")/3
306
		xi <- xmax + strwidth(" ")/3
307
		yi <- bi2*xi
307
		yi <- bi2*xi/p
308
		abline(0, bi2, lty = 2)
308
		abline(0, bi2, lty = 2)
309
		text(xi, yi, paste(bval[i]), adj = 0, xpd = TRUE)
309
		text(xi, yi, paste(bval[i]), adj = 0, xpd = TRUE)
310
	    } else {
310
	    } else {
311
		yi <- ymax - 1.5*strheight(" ")
311
		yi <- ymax - 1.5*strheight(" ")
312
		xi <- yi/bi2
312
		xi <- p*yi/bi2
313
		lines(c(0, xi), c(0, yi), lty = 2)
313
		lines(c(0, xi), c(0, yi), lty = 2)
314
		text(xi, ymax-0.8*strheight(" "), paste(bval[i]),
314
		text(xi, ymax-0.8*strheight(" "), paste(bval[i]),
315
		     adj = 0.5, xpd = TRUE)
315
		     adj = 0.5, xpd = TRUE)

Return to bug 17161