tomw
tomw

Reputation: 3158

Linetype for points in ggplot2

I'm trying to get a hollow point to have the same line type as an associated line range. For instance

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()

returns this

pointrange

How so I get the points' borders to also be dashed?

Upvotes: 0

Views: 740

Answers (1)

tomw
tomw

Reputation: 3158

with thanks to @Henrik, ggforce::geom_circle() has the necessary functionality

Upvotes: 1

Related Questions