ggplot2中点的线型

时间:2018-10-22 19:25:34

标签: r ggplot2

我试图获取一个空心点,使其具有与关联的线范围相同的线型。例如

library(tidyverse)

data.frame(
    x = letters[1:2] %>% 
      factor,
    ymin = 4:5,
    y = 5:6,
    ymax = 6:7
  ) %>% 
  ggplot() +
  geom_linerange(
    aes(x, ymin = ymin, ymax = ymax),
    linetype = "dashed"
  ) +
  geom_point(
    aes(x = x, y = y),
    shape = 21,
    size = 10,
    fill = "grey95",
    linetype = "dashed"
    ) +
  theme_void()

返回此

pointrange

我如何才能使点的边界也变为虚线?

1 个答案:

答案 0 :(得分:1)

感谢@Henrik,ggforce::geom_circle()具有必要的功能