Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FCrSTATS/SBpitch
Create a pitch plot ready for Statsbomb data
https://github.com/FCrSTATS/SBpitch
Last synced: about 2 months ago
JSON representation
Create a pitch plot ready for Statsbomb data
- Host: GitHub
- URL: https://github.com/FCrSTATS/SBpitch
- Owner: FCrSTATS
- Created: 2018-06-13T03:39:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-19T14:38:14.000Z (about 6 years ago)
- Last Synced: 2024-02-04T11:12:31.736Z (5 months ago)
- Language: R
- Size: 95.7 KB
- Stars: 47
- Watchers: 4
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Lists
- awesome-soccer-analytics - SBpitch - (R) Creates customisable plots of pitches in ggplot2 that allows event data to be plotted on top. (Open Source Libraries / Visualisation)
README
# SBpitch
Statsbomb have released a [free dataset](https://statsbomb.com/resource-centre) to help the public get used to their data product but also provide data to kick start people's journey into football analytics.To help people on their journey I have created a R package that creates customisable plots of pitches in ggplot2 that allows event data to be plotted on top.
I have also created some [tutorials](https://github.com/FCrSTATS/StatsBomb_WomensData) to help others explore the data.
## Installation
Installation is straight forward via the devtools package and the install_github() function.
```R
devtools::install_github("FCrSTATS/SBpitch")
```## The Default Plot
The package offers lots of customisable features but the default plot.
```R
create_Pitch()
```![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown.png)
## Variables to Customise
#### Basic Features
```R
create_Pitch(BasicFeatures = TRUE)
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-1.png)#### Middle Third Shading
```R
create_Pitch(middlethird = TRUE))
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-2.png)#### Box Type
Line Design
```R
create_Pitch(goaltype = "line")
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown.png)Box Design
```R
create_Pitch(goaltype = "box")
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-3.png)[Barca Numbers](https://twitter.com/barcanumbers) Design
```R
create_Pitch(goaltype = "barcanumbers")
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-4.png)#### Juego de Posicion
```R
create_Pitch(JdeP = TRUE)
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-5.png)## Colour Schemes
There are 4 colours that you can adjust
#### Blue Example
```R
create_Pitch(grass_colour = "#224C56",
line_colour = "#B3CED9",
background_colour = "#224C56",
goal_colour = "#15393D")
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-6.png)#### Night Example
```R
create_Pitch(grass_colour = "#202020",
line_colour = "#797876",
background_colour = "#202020",
goal_colour = "#131313")
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-7.png)#### Green Example
```R
create_Pitch(grass_colour = "#538032",
line_colour = "#ffffff",
background_colour = "#538032",
goal_colour = "#000000")
```
![](https://github.com/FCrSTATS/SBpitch/blob/master/images/Unknown-8.png)