dotglyphGrob | R Documentation |
Uses Grid
graphics to draw a dot profile glyph
\insertCitechambers_graphical_1983,dutoit_graphical_1986gglyph.
dotglyphGrob( x = 0.5, y = 0.5, z, radius = 1, col = "black", fill = NA, lwd = 1, alpha = 1, mirror = FALSE, flip.axes = FALSE )
x |
A numeric vector or unit object specifying x-locations. |
y |
A numeric vector or unit object specifying y-locations. |
z |
A numeric vector specifying the values to be plotted as dimensions of the dot glyph (number of stacked dots). |
radius |
The radius of the glyphs. |
col |
The line colour. |
fill |
The fill colour. |
lwd |
The line width. |
alpha |
The alpha transparency value. |
mirror |
logical. If |
flip.axes |
logical. If |
A grob
object.
geom_dotglyph
Other grobs:
metroglyphGrob()
,
pieglyphGrob()
,
profileglyphGrob()
,
starglyphGrob()
,
tileglyphGrob()
dg1 <- dotglyphGrob(x = 150, y = 300, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2) dg2 <- dotglyphGrob(x = 550, y = 300, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, mirror = TRUE) dg3 <- dotglyphGrob(x = 100, y = 550, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, flip.axes = TRUE) dg4 <- dotglyphGrob(x = 550, y = 550, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, mirror = TRUE, flip.axes = TRUE) grid::grid.newpage() grid::grid.draw(dg1) grid::grid.draw(dg2) grid::grid.draw(dg3) grid::grid.draw(dg4) dg1 <- dotglyphGrob(x = 150, y = 300, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, fill = "black", col = "white") dg2 <- dotglyphGrob(x = 550, y = 300, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, mirror = TRUE, fill = "salmon", col = "black") dg3 <- dotglyphGrob(x = 100, y = 550, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, flip.axes = TRUE, fill = "cyan", col = "grey") dg4 <- dotglyphGrob(x = 550, y = 550, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, mirror = TRUE, flip.axes = TRUE, fill = "green", col = "grey") grid::grid.newpage() grid::grid.draw(dg1) grid::grid.draw(dg2) grid::grid.draw(dg3) grid::grid.draw(dg4) clrs <- mapply(function(a, b) rep(a, b), RColorBrewer::brewer.pal(6, "Dark2"), round(c(4, 3.5, 2.7, 6.8, 3.4, 5.7))) clrs <- unlist(clrs) dg1 <- dotglyphGrob(x = 150, y = 300, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, fill = clrs, col = "white") dg2 <- dotglyphGrob(x = 550, y = 300, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, mirror = TRUE, fill = clrs, col = "black") dg3 <- dotglyphGrob(x = 100, y = 550, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, flip.axes = TRUE, fill = "black", col = clrs, lwd = 5) dg4 <- dotglyphGrob(x = 550, y = 550, z = c(4, 3.5, 2.7, 6.8, 3.4, 5.7), radius = 2, mirror = TRUE, flip.axes = TRUE, col = clrs) grid::grid.newpage() grid::grid.draw(dg1) grid::grid.draw(dg2) grid::grid.draw(dg3) grid::grid.draw(dg4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.