Thanks to the ggplot2 team and community for the great work on this package.
When I draw multiple dashed segments with geom_segment() in ggplot2, segments with different start positions but the same end position have visibly misaligned dash endpoints. It seems the dash pattern is anchored at each segment's start, so the visible ends don't line up even when the end coordinates are identical.
library(ggplot2)
packageVersion("ggplot2")
#> [1] '4.0.0'
df <- data.frame(
x = c(1, 2, 3),
x_end = c(4, 4, 4),
y = c(1, 2, 3)
)
ggplot() +
geom_segment(
data = df,
aes(x = x, y = y , xend = x_end, yend = y),
linetype = "dashed",
colour = "steelblue"
)

Created on 2025-11-25 with reprex v2.1.1