[R] user coordinates and rug plots in lattice graphics

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Apr 9 00:25:42 CEST 2002


"Paul Murrell" <p.murrell at auckland.ac.nz> writes:

>      # rug lines are 3mm high
>      xyplot(y~x|f,
>             panel = function(x,y,...) {
>               panel.xyplot(x,y,...)
>               grid.segments(x, unit(0, "npc"), x, unit(3, "mm"),
>                             default.units="native")
>          })
>      # rug lines are 1/20th of the height of the plot
>      xyplot(y~x|f,
>             panel = function(x,y,...) {
>               panel.xyplot(x,y,...)
>               grid.segments(x, unit(0, "npc"), x, unit(0.05, "npc"),
>                             default.units="native")
>          })
> 
> ... of course, the downside is that you have to encounter the raw grid
> functions to do this.

Sorry for butting in (and possibly revealing my ignorance about the
inner workings of grid and lattice), but wouldn't lines of text be a
natural unit here? 

It has BTW crossed my mind that the current rug() using axis() is
rather unfortunate if you want to have multiple rugs on several lines
at the bottom of a plot, and that a version using segments() might be
better.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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