geom_rrect | R Documentation |
Does what ggplot2::geom_rect()
does, only curvier.
geom_rrect( mapping = NULL, data = NULL, stat = "identity", position = "identity", radius = grid::unit(6, "pt"), ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
radius |
radius of rectangle corners (using |
... |
Other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom_tile()
understands the following aesthetics (required aesthetics are in bold):
x
y
alpha
colour
fill
group
height
linetype
size
width
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
library(ggplot2) data.frame( x = rep(c(2, 5, 7, 9, 12), 2), y = rep(c(1, 2), each = 5), z = factor(rep(1:5, each = 2)), w = rep(diff(c(0, 4, 6, 8, 10, 14)), 2) ) -> xdf ggplot(xdf, aes(xmin = x - w / 2, xmax = x + w / 2, ymin = y, ymax = y + 1)) + geom_rrect(aes(fill = z), colour = "white")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.