Torvaney / ggsoccer

Plot soccer event data in R/ggplot2
https://torvaney.github.io/ggsoccer/
Other
178 stars 27 forks source link

Make goals a different colour to the pitch #2

Open Torvaney opened 6 years ago

Torvaney commented 6 years ago

It looks weird having a green pitch and green goals (as in README.md).

Torvaney commented 6 years ago

Maybe decompose annotate_pitch into annotate_markings() + annotate_goals(style = ...) to allow different goal styles (or have different annotate_goal_* functions).

Would also prevent code duplication for markings at either end of the pitch.

Torvaney commented 6 years ago

Actually, decomposing all the different markings into annotate_* functions seems like maybe the best solution (if we do go down this route). Could be a pain for users if an argument is applied to all of them (like x_scale), but this could be solved by either supporting !!! list expansion (maybe ggplot 3.0.0 does this out of the box?).

This would allow more flexible plotting against different (non-Opta) specifications as well.

Torvaney commented 3 years ago

Latest change (0.1.7) helps with this by adding arbitrary goal functions, but it's still not as nice as I'd like. For one thing, the colour is still locked to the colour of the pitch (unless you create your own function where colour and fill have different names). So I'll leave this open for now.