Thanks to all for the postings so far!

I found that setting asp=0.5 and then dividing the slope by 2 seems to do
the trick:

##

x=1:10
y=x*2-rnorm(1:10)

plot(x,y,pch=16,asp=0.5)
abline(lm(y~x))
yval=predict(lm(y~x),list(x=rep(2,length(x))))[1]
slope=as.numeric(lm(y~x)[[1]][2])
text(2,yval,"Regression",srt=180/pi*atan(slope/2),adj=0)

##

This might be a way of controlling for the aspect ratio witho8ut producing
"ugly" figures.

______________________________________________
R-help@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.

Reply via email to