Repository navigation
Releases: Sport-Performance-Lab/mplhockey
Releases · Sport-Performance-Lab/mplhockey
Release list
v1.0.2
What's Changed
- Added support for contour and contourf by @jefferybarrett in #4
- nudging the version by @jefferybarrett in #5
- Stage for v1.0.2 by @jefferybarrett in #6
Full Changelog: v1.0.1...v1.0.2
v1.0.1
What's Changed
- fixed bug where rink would not render on multiple axes by @jefferybarrett in #2
- Stage for 1.0.1 release by @jefferybarrett in #3
New Contributors
- @jefferybarrett made their first contribution in #2
Full Changelog: v1.0.0...v1.0.1
v1.0.0
mplhockey 1.0.0 - Initial Release
Overview
mplhockey is a Python library for plotting hockey rink charts in Matplotlib. This lightweight, composable library is designed specifically for hockey analytics and visualization workflows, inspired by similar projects like mplsoccer and mplbasketball.
Core Features
League Support
The library provides rink geometries for six different leagues:
- NHL - National Hockey League (200 ft × 85 ft)
- NCAA - NCAA college hockey
- IIHF - International Ice Hockey Federation
- KHL - Kontinental Hockey League
- PWHL - Professional Women's Hockey League (same dimensions as NHL)
- NRL - National Ringette League
Flexible Unit System
- Support for 40+ unit types including: m, ft, cm, in, yd, km, mi, mm, and many more
- Units can be specified at rink instantiation or at draw time
- All geometries scale correctly with unit conversions
Coordinate System
- Right-handed Cartesian system centered at center ice
- Origin (0, 0) at center ice
- X-axis: along rink length
- Y-axis: across rink width
- Perfect for overlaying spatial data (shots, tracking data, model outputs)
Theme System
- Four built-in themes:
light,dark,over-dark,over-light - Customizable color schemes via dictionary override
- Color scheme loaded from YAML with caching mechanism
- Support for "none" color values for transparent elements
Rotation & Display Ranges
- Arbitrary rotation capability (in degrees)
- Pre-defined display ranges for specific zones:
- Full rink view
- Attacking zone (ozone)
- Defensive zone (dzone)
- Neutral zone (nzone)
- Goal areas (ogoal/dgoal)
- Useful for consistent attacking-direction visualizations
Rich Geometric Features
- Nets, creases, boards, ice surface
- Goal areas, trapezoid zones
- Faceoff circles and markings
- League-specific geometries
- Feature mirroring (auto-symmetry for width/length)
Matplotlib Integration
- Renders as standard Matplotlib artists
- Compatible with scatter plots, lines, contours, heatmaps
- Supports all Matplotlib export formats (PNG, SVG, PDF, etc.)
- Custom axes control and styling
Extensible Design
- Easy to add new leagues, historical dimensions, or custom surfaces
- Feature-based architecture for modular rendering
- YAML-based rink specifications
Technical Details
Compatibility
- Python 3.9+
- Explicit support for Python 3.13 and 3.14
Dependencies
- matplotlib>=3.9.0,<4
- shapely>=2.0.7,<3
- numpy>=2.1.0 (py3.13+) or >=1.26.0 (py3.12-)
- pyyaml>=6.0.3
Testing & Quality Assurance
- Comprehensive test suite with pytest
- Visual regression testing with pytest-mpl
- Extensive baseline test images
CI/CD Pipeline
- GitHub Actions workflow for automated testing
- PyPI publishing pipeline
Design Philosophy
mplhockey is deliberately focused on geometry and rendering only:
- Does NOT fetch or manage hockey data
- Does NOT impose a data model for events/players
- Does NOT replace general-purpose plotting libraries
- Aims to be a robust, composable building block for analysis and visualization pipelines
License
MIT License (Copyright 2026 MLSE Ltd.)
Links
- Repository: github.com/mlsedigital/mplhockey
- Documentation: See README.md and docs/ directory