Description Usage Arguments Details Value See Also Examples
This function draws ggplot2 segments or circles in a handwritten style.
1 |
mapping |
Mapping between variables and aesthetics generated by aes. See Details. |
data |
Dataset used in this layer. |
typexkcdline |
A string value. If it is |
mask |
Logical. If it is true, it erases the pictures that are under the line. |
... |
Optional arguments. |
It draws a segment or a circunference in a XKCD style. If it is a segment, the following aesthetics are required:
xbegin: x position of the point from.
ybegin: y position of the point from.
xend: x position of the point to.
yend: y position of the point to.
If it is a circunference, the following aesthetics are required:
x: x position of the center.
y: y position of the center.
diameter: diameter of the circunference.
Additionally, you can use the aesthetics of geom_path
,
pointssegment
and pointscircunference
.
A ggplot layer.
aes
,
geom_path
,
pointssegment
,
pointscircunference
1 2 3 4 5 6 7 8 9 10 | data <- data.frame(x1=c(1,2), y1=c(10,20), xend=c(2.5,0.5),
yend=c(20,10), model=c("low","high"))
ggplot() + xkcdline(mapping=aes(xbegin=x1 +y1, ybegin=y1, xend =xend, yend= yend,
color = model), data=data)
ggplot() + xkcdline(mapping=aes(xbegin=x1 +y1, ybegin=y1, xend =xend, yend= yend,
color = model), data=data) + facet_grid(. ~ model)
ggplot() + xkcdline(mapping=aes(x=x1 +y1, y=y1, diameter =xend), data=data, type="circunference")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.