[R] Label data points in scatterplot matrices

Dieter Menne dieter.menne at menne-biomed.de
Sun Dec 5 10:34:31 CET 2004


Uwe Ligges <ligges <at> statistik.uni-dortmund.de> writes:

> Well, in principle you cannot easily (it's a warning, not an errror, BTW).
> But you can fake a little bit by, e.g., renaming "z" to "pch":
> 
>   panel.hist <- function(x, ...)
>       {
>           usr <- par("usr"); on.exit(par(usr))
>           par(usr = c(usr[1:2], 0, 1.5) )
>           h <- hist(x, plot = FALSE)
>           breaks <- h$breaks; nB <- length(breaks)
>           y <- h$counts; y <- y/max(y)
>           rect(breaks[-nB], 0, breaks[-1], y, col="cyan", ...)
>       }
> 
> pairs(USJudgeRatings[1:5], panel=panel.text,
>             cex = 1.5, pch = z, bg="light blue",
>             diag.panel=panel.hist, cex.labels = 2, font.labels=2)
 

You are mixing standard graphics of hist with lattice/trellis. Give
panel.histogram a try instead.

Dieter




More information about the R-help mailing list