[R] Eyeball problem ...

John Logsdon j.logsdon at lancaster.ac.uk
Wed Feb 3 14:38:10 CET 1999


Just a point about plotting and abline with a dotted grid.  Try this for
size: 

eh<-function (mx, my, line='dotted') 
{
    x <- c(0, mx)
    y <- c(0, my)
    plot(x, y, "l")
    abline(v = seq(0, mx, 10), h = seq(0, my, 10), lty = line)
}

eh(100,100)
eh(100,1000)
eh(100,5000)
eh(100,10000)

When there are enough horizontal lines, the dotted characteristic makes it
look vertical!  Had me puzzled for a bit.  Try it with line='' as well. 
Actually it is worse with (eg) eh(10000,100) but I was considering your
collective health.

Is there any simple way of returning the axis label values that can be
passed to abline, or enforcing abline to put the grid against these?  This
is what I was actually trying to do when my eyeballs fell out.

\John

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list