geom_path diameter to scale with coordinate system

149 views Asked by At

I'm using ggplot to plot some trajectories. I would like the size (diameter or radius) of the geom_path line to be with respect to the coordinate system.

Here is some reproducible code:

x <- c(1,5,3,7,6)
y <- c(0,6,4,4,8)
data <- as.data.frame(cbind(x, y))
ggplot(data, aes(x = x, y = y)) + geom_path(size = 2, lineend = "round") + coord_fixed(ratio = 1)

In this case, I'd like the diameter of the line to be 2 coordinate system units.

0

There are 0 answers