| xkcdrect | R Documentation |
It draws fuzzy rectangles.
xkcdrect(
mapping,
data,
...,
fillcolour = "grey90",
bordercolour = "black",
borderlinewidth = 0.5,
borderxjitteramount = 0.005,
borderyjitteramount = 0.005
)
mapping |
Mapping between variables and aesthetics generated by |
data |
Dataset used in this layer. |
... |
Optional arguments. |
fillcolour |
The fill colour of the rectangle. |
bordercolour |
The colour of the fuzzy border lines. |
borderlinewidth |
The thickness of the fuzzy border lines. This is the package's implementation of the |
borderxjitteramount |
Horizontal jitter amount for the border. |
borderyjitteramount |
Vertical jitter amount for the border. |
This function draws fuzzy rectangles.
It plots rectangles. The following aesthetics are required:
xmin
ymin
xmax
ymax
Additionally, you can use the aesthetics of geom_path and geom_rect.
A layer.
aes, geom_path
## Not run:
volunteers <- data.frame(year = c(2007:2011),
number = c(56470, 56998, 59686, 61783, 64251))
xrange <- range(volunteers$year)
yrange <- range(volunteers$number)
p <- ggplot() +
xkcdrect(aes(xmin = year - 0.2,
xmax = year + 0.2,
ymin = number - 500,
ymax = number + 500),
data = volunteers,
fillcolour = "pink",
borderlinewidth = 1.2) +
geom_point(aes(x = year, y = number), data = volunteers) +
xkcdaxis(xrange, yrange) +
theme_xkcd()
p
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.