{ "cells": [ { "cell_type": "markdown", "id": "ba2d3f24", "metadata": {}, "source": [ "# Pitch Examples" ] }, { "cell_type": "code", "execution_count": 1, "id": "5377871b", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/martin/repos/penaltyblog/venv/lib/python3.13/site-packages/statsbombpy/api_client.py:21: NoAuthWarning: credentials were not supplied. open data access only\n", " warnings.warn(\n" ] } ], "source": [ "from penaltyblog.viz import Pitch\n", "from penaltyblog.matchflow import Flow, where_equals, get_field\n", "from IPython.display import HTML\n", "import plotly.io as pio\n", "\n", "\n", "flow = (\n", " Flow\n", " .statsbomb\n", " .events(22912)\n", " .cache()\n", ")" ] }, { "cell_type": "markdown", "id": "02b55b8b", "metadata": {}, "source": [ "## Scatter Plot\n", "\n", "The scatter plot is the most versatile and commonly used chart for visualizing individual events or locations on the pitch. Each marker represents a single data point - such as a shot, pass, or player position - plotted using its `(x, y)` coordinates. This type of chart is ideal for exploring patterns, clusters, or areas of activity. You can customize marker size, color, and tooltip content to highlight specific aspects of the data. Hover over the dots to reveal interactive tooltips with additional context, such as player names, event types, or timestamps. Note that by default, the tooltips will only show the x and y coordinates of the marker." ] }, { "cell_type": "code", "execution_count": 2, "id": "d5874344", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/martin/repos/penaltyblog/venv/lib/python3.13/site-packages/statsbombpy/api_client.py:21: NoAuthWarning:\n", "\n", "credentials were not supplied. open data access only\n", "\n" ] }, { "data": { "text/html": [ "\n", "
\n", "\n", "