{ "cells": [ { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "from highlight_text import fig_text\n", "import matplotlib as mpl\n", "from mplsoccer.pitch import Pitch" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [], "source": [ "#Set general use colors\n", "text_color = 'w'" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [], "source": [ "data = pd.read_csv('shotmaps.csv')" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | minute | \n", "second | \n", "team | \n", "x | \n", "y | \n", "outcome | \n", "
---|---|---|---|---|---|---|
0 | \n", "21 | \n", "42 | \n", "Barcelona | \n", "50.88 | \n", "85.20 | \n", "Saved | \n", "
1 | \n", "29 | \n", "33 | \n", "Barcelona | \n", "34.96 | \n", "91.68 | \n", "Missed | \n", "
2 | \n", "35 | \n", "3 | \n", "Barcelona | \n", "44.40 | \n", "101.64 | \n", "Saved | \n", "
3 | \n", "41 | \n", "3 | \n", "Barcelona | \n", "27.92 | \n", "96.36 | \n", "Saved | \n", "
4 | \n", "42 | \n", "9 | \n", "Barcelona | \n", "50.40 | \n", "104.88 | \n", "Saved | \n", "
5 | \n", "42 | \n", "13 | \n", "Barcelona | \n", "21.60 | \n", "108.00 | \n", "Missed | \n", "
6 | \n", "45 | \n", "32 | \n", "Barcelona | \n", "47.84 | \n", "107.64 | \n", "Saved | \n", "
7 | \n", "46 | \n", "51 | \n", "Barcelona | \n", "47.04 | \n", "89.76 | \n", "Saved | \n", "
8 | \n", "57 | \n", "31 | \n", "Barcelona | \n", "48.64 | \n", "107.04 | \n", "Post | \n", "
9 | \n", "60 | \n", "12 | \n", "Barcelona | \n", "33.76 | \n", "101.64 | \n", "Missed | \n", "
10 | \n", "64 | \n", "29 | \n", "Barcelona | \n", "37.36 | \n", "98.28 | \n", "Saved | \n", "
11 | \n", "66 | \n", "58 | \n", "Barcelona | \n", "50.72 | \n", "107.52 | \n", "Missed | \n", "
12 | \n", "69 | \n", "12 | \n", "Barcelona | \n", "37.36 | \n", "98.28 | \n", "Missed | \n", "
13 | \n", "69 | \n", "57 | \n", "Barcelona | \n", "54.56 | \n", "104.04 | \n", "Saved | \n", "
14 | \n", "77 | \n", "5 | \n", "Barcelona | \n", "52.32 | \n", "89.76 | \n", "Saved | \n", "
15 | \n", "80 | \n", "9 | \n", "Barcelona | \n", "46.24 | \n", "91.44 | \n", "Missed | \n", "
16 | \n", "82 | \n", "51 | \n", "Barcelona | \n", "41.12 | \n", "97.80 | \n", "Saved | \n", "
17 | \n", "84 | \n", "15 | \n", "Barcelona | \n", "27.44 | \n", "87.84 | \n", "Missed | \n", "
18 | \n", "87 | \n", "51 | \n", "Barcelona | \n", "28.88 | \n", "96.36 | \n", "Missed | \n", "
19 | \n", "89 | \n", "6 | \n", "Barcelona | \n", "42.08 | \n", "99.36 | \n", "Saved | \n", "