Closed teunbrand closed 2 years ago
This should now be possible:
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.1.1
library(ggh4x)
set.seed(0)
df <- data.frame(
x = c(1:7, 1:5, 1:6),
y = rnorm(7 + 5 + 6),
g = rep(LETTERS[1:3], c(7, 5, 6))
)
ar <- arrow(ends = "both", type = "closed", length = unit(2, "mm"))
p <- ggplot(df, aes(x, y, colour = g, group = g)) +
geom_pointpath(arrow = ar)
p
p + coord_polar()
Created on 2021-11-02 by the reprex package (v2.0.1)
Such that the line between two points can have arrows.
Note to self: be careful that also the
coord_polar()
case works.