Thursday, May 2, 2013

RG#103: Combing different types of plot in trellis type


require(lattice)
require(latticeExtra)

#xy plot, conditioned from quakes data, with histogram 
qk <- xyplot(lat ~ long | equal.count(depth, 2), quakes,
    aspect = "iso", pch = "+", cex = 1.5, xlab = NULL, ylab = NULL)
qk <- c(qk, depth = histogram(quakes$depth), layout = c(3, 1))
update(qk, scales = list(at = list(NA, NA, NA, NA),
                          y = list(draw = FALSE)))



# suppress scales on the first 2 panels
update(qk, scales = list(at = list(NULL, NULL, NA), y = list(draw = FALSE)))




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.