I am creating a ggplot
chart where I want to have some arrows between two points. The main task is easily done with geom_line(arrow = arrow())
. However, I want to have some "beautiful" thick arrows. Resizing the arrow via size=
doesn't help since it messes up the head of the arrow completely. I illustrate my Problems:
Create some sample data and a plot:
NAME <- c("A", "A", "B", "B", "C", "C")
YEAR <- c(2016, 2011, 2016, 2011, 2016, 2011)
YEAR <- as.factor(YEAR)
VALUE <- c(1, 4, 1, 5, 2, 8)
DATA <- data.frame(NAME, YEAR, VALUE)
ggplot(DATA, aes(x=VALUE, y=NAME)) +
geom_point(size=5, aes(colour=YEAR)) +
geom_line(arrow = arrow(length=unit(0.30,"cm"), ends="first", type = "closed"))
The resulting plot looks like that:
Now I've tried to "thicken" the arrows...
ggplot(DATA, aes(x=VALUE, y=NAME)) +
geom_point(size=5, aes(colour=YEAR)) +
geom_line(arrow = arrow(length=unit(0.30,"cm"), ends="first", type = "closed"), size = 3)
That's the result shown here:
My question: Is there any way to plot some "beautiful" thick arrows?
linetype
(can make line dotted of dashed etc),arrow length
, etc. – Lewie