Ich möchte drei Punkte "a", "b" und "c" mit geom_line verbinden, aber es verbindet nur "ab" und "bc", aber nicht "ca", wie kann ich das erreichen mit geom_line oder geom_path, anstatt geom_polygon?In ggplot 2, wie man die Start- und Endpunkte in geom_line verbindet
library(ggplot2)
df <- data.frame (line =c ("a", "b", "c"), x = c(1, 2, 3), y = c(5, 2, 5))
ggplot() +
geom_path(data = df, aes (x = x, y = y, color = line))
Gute Frage! Willst du die Legende auch? Hast Du es versucht? Wenn ja, bitte teilen Sie Ihren Code. – watchtower