thomasp85 / ggforce

Accelerating ggplot2
https://ggforce.data-imaginist.com
Other
916 stars 105 forks source link

geom_mark_rect not facetting the same as geom_mark_circle #307

Closed maddyduran closed 7 months ago

maddyduran commented 1 year ago

I am trying to facet a plot and keep the geom_mark_rect consistent across facets, but it appears on only one panel. However, when I use geom_mark_circle or geom_mark_ellipse, I don't get the same behavior as demonstrated here. image

image

this was the code I used to produce these plots as an example:

iris_1 = iris
iris_1$split = "a"
iris_2 = iris
iris_2$split = "b"

double_iris = rbind(iris_1, iris_2)

double_iris %>% 
  ggplot(aes(Petal.Length, Petal.Width)) +
  geom_mark_rect(aes(color = Species)) +
  geom_point() + facet_col(~split) 

double_iris %>% 
  ggplot(aes(Petal.Length, Petal.Width)) +
  geom_mark_circle(aes(color = Species)) +
  geom_point() + facet_col(~split)