sportsdataverse / sportyR

R package for drawing regulation playing surfaces for several sports
https://sportyR.sportsdataverse.org
GNU General Public License v3.0
103 stars 7 forks source link

facet_wrap not working #26

Closed philly1993 closed 1 year ago

philly1993 commented 1 year ago

When trying to use facet_wrap only one facet appears with the rink

image

data <- tibble(x = c(0, 22, -22, 41),
               y = c(50, 25, 85, 41.3),
               group = c("shot", "shot", "goal", "goal"))

geom_hockey("NHL", "ozone", rotation = 90) +
  geom_point(data = data, aes(x = x, y = y, color = group)) +
  facet_wrap(~group)
rossdrucker commented 1 year ago

I've gotten the rink to appear on both facets by using facet_grid(~group) instead, however there seems to be an issue with the faceted data displaying correctly. I'm not sure what's going on with that quite yet, but will adjust as soon as I can figure it out. Everything as far as I can tell seems to match what I'd expect to happen when faceting this way

rossdrucker commented 1 year ago

@philly1993 Now addressed thanks to @mrcaseb on #27. Should be released in the next CRAN update, thanks for pointing this out!

philly1993 commented 1 year ago

@rossdrucker Thanks! Just loaded up version of package via GitHub install and it works as I expected. Thanks for the quick fix.