[R] Problem plotting axes on graphs

Les Stather lesj_stather at hotmail.co.uk
Sun Sep 14 13:02:16 CEST 2008


2008/9/14 lesj_stather at hotmail.co.uk


I ran your example

Speed <- cars$speed
Distance <- cars$dist
> Speed
 [1]  4  4  7  7  8  9 10 10 10 11 11 12 12 12 12 13 13 13 13 14 14 14 14 15 
15
[26] 15 16 16 17 17 17 18 18 18 18 19 19 19 20 20 20 20 20 22 23 24 24 24 24 
25
> Distance
 [1]   2  10   4  22  16  10  18  26  34  17  28  14  20  24  28  26  34  34 
46
[20]  26  36  60  80  20  26  54  32  40  32  40  50  42  56  76  84  36  46 
68
[39]  32  48  52  56  64  66  54  70  92  93 120  85

plot(Speed, Distance, panel.first = grid(8,8),
     pch = 0, cex = 1.2, col = "blue")
plot(Speed, Distance,
     panel.first = lines(stats::lowess(Speed, Distance), lty = "dashed"),
     pch = 0, cex = 1.2, col = "blue")

And got the following

Error in axis(side = side, at = at, labels = labels, ...) :
  too few arguments


I got a graph of the points with a dashed lined line through them but did 
not get any axes

I am runing R 2.7.2 under windowa XP Service Pack 2 on an Acer Extensa 5200


Les Stather
____________________________________________
> 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.
>



More information about the R-help mailing list