[R] abline is not plotting

hans74 hans_hans74 at gmx.de
Fri Oct 4 16:16:49 CEST 2013


Hello there,

I have some data I want to plot together with a best-fit line. (see MWE
below)
The points from the first plot does appear as expected, but the abline does
not appear, no matter what I change. I removed the log parameter before, but
the abline is a very steep line around the origin. I really want to keep the
logarithmic scale, plus a working abline.

Can someone help me with that? What am I doing wrong?

Thanks in advance,
Hans

#############
d = data.frame( x = c(154471 , 517423 , 704286 , 236117 , 10664898 , 21887 ,
104994 , 794101 , 289567 , 74818 , 63920 , 251053 , 263583 , 84882 , 55075 ,
741076 , 92000 , 137799 , 59856 , 184992 , 8292355),
                   y = c(624 , 1681 , 590 , 2073 , 12189 , 42 , 343 , 365 ,
969 , 108 , 366 , 1664 , 738 , 420 , 318 , 1278 , 887 , 395 , 462 , 1376 ,
17907)
                 )
plot(d, log = "xy")
abline(lm(x ~ y, data = d))



--
View this message in context: http://r.789695.n4.nabble.com/abline-is-not-plotting-tp4677583.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list