ggplot2
我想用箭头和标签画出四分之三的圆圈。使用ggplot2
并且ggforce
我发现了一些可行的方法,但它似乎非常复杂。
有没有更简单的选择来实现我想要的?
df <- data.frame(x = 100, y = 100, label = "R")
library(ggplot2)
library(ggforce)
r <- 10
ggplot(df) +
geom_circle(aes(x0 = x, y0 = y, r = r)) +
geom_rect(aes(xmin = x, ymin = y, xmax = x + r + 1, ymax = x + r + 1),
fill = "white") +
geom_segment(aes(x = x + r, y = y, xend = x + r, yend = y + 1),
arrow = arrow()) +
annotate("text", x = df$x, y = df$y, label = df$label) +
theme_void()