View source: R/isobands-grob.R
isobands_grob | R Documentation |
This function generates a grid grob that represents isobands.
isobands_grob(bands, gp = gpar(), units = "npc")
bands |
Isobands, as produced by the |
gp |
Grid graphical parameters. Parameters are recycled among the total number of bands drawn. |
units |
A character string specifying the units in which to
interpret the isobands coordinates. Defaults to |
See isolines_grob()
for drawing of isolines.
library(grid) viridis_pal <- colorRampPalette( c("#440154", "#414487", "#2A788E", "#22A884", "#7AD151", "#FDE725"), space = "Lab" ) x <- (1:ncol(volcano))/(ncol(volcano)+1) y <- (nrow(volcano):1)/(nrow(volcano)+1) bands <- isobands(x, y, volcano, 5*(18:38), 5*(19:39)) b <- isobands_grob( bands, gp = gpar(col = "black", fill = viridis_pal(21), alpha = 0.5) ) grid.newpage() grid.draw(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.