我能够通过这个问题的答案在ggplot中找到geom_curve控制点:
现在我想知道如何将这个函数应用于geom_line,以获得我在ggplot上创建的所有沿geom_line的控制点。
b$data [[1]]
给出起点和终点,
p$layers [[1]]$geom_params
给出曲线信息(角度、曲率等)。
但是,我该如何找到沿着geom_line的所有坐标/点,以便我可以使用这些点重新生成该行?
C <- ggplot() +
geom_sf(data = world, fill = "grey69", size = 0.1, colour = "transparent") +
scale_x_continuous(limits = c(-180, 180), breaks = seq(-180, 180, by = 40)) +
scale_y_continuous(limits = c(-90, 90), breaks = seq(-90, 90, by = 30)) +
coord_sf(expand = FALSE) +
labs(x = "Longitude", y = "Latitude") +
geom_sf(data = world, color = "grey87", fill = "grey87", size = 0.1) +
geom_line(aes(c(19, 6),c(-32,-40)),
lineend = "round", size = 0.4, col = "gray20", linetype = "solid", alpha = 0.6)