ColorBrewer
Purpose
Use grid graphics and RColorBrewer package for DP
> library(grid) > library(RColorBrewer) > cols <- brewer.pal(4, "Set1") > vplay <- grid.layout(2, 2, respect = rbind(c(0, 0), c(1, 0))) > grid.newpage() > pushViewport(viewport(layout = vplay)) > pushViewport(viewport(layout.pos.col = 1, layout.pos.row = 1)) > grid.rect(gp = gpar(fill = cols[1])) > grid.text("Adjoint") > popViewport() > pushViewport(viewport(layout.pos.col = 1, layout.pos.row = 2)) > grid.rect(gp = gpar(fill = cols[2])) > grid.text("Normal") > popViewport() > pushViewport(viewport(layout.pos.col = 2, layout.pos.row = 1)) > grid.rect(gp = gpar(fill = cols[3])) > grid.text("Positive") > popViewport() > pushViewport(viewport(layout.pos.col = 2, layout.pos.row = 2)) > grid.rect(gp = gpar(fill = cols[4])) > grid.text("Isometry") > popViewport() |
Grobs
For each grid function that produces graphical output, there is a counterpart that produces a graphical object and no graphical output. For each function that works with grobs on the grid display list, there is counterpart for working with grobs off-screen.
> grid.rect(width = grobWidth(textGrob(" Some text "))) |