Skip to content
Vega-Lite templates

Player Position Heatmap

2D position-density heatmap over a normalised pitch.

Template previewVega-Lite
Rendering…

Make it your own.

{
  "$schema":"https://vega.github.io/schema/vega-lite/v5.json",
  "data":{"values":[
    {"x":0.1,"y":0.5,"d":3},{"x":0.2,"y":0.4,"d":8},{"x":0.2,"y":0.6,"d":7},
    {"x":0.3,"y":0.5,"d":15},{"x":0.4,"y":0.4,"d":18},{"x":0.4,"y":0.6,"d":22},
    {"x":0.5,"y":0.3,"d":12},{"x":0.5,"y":0.5,"d":40},{"x":0.5,"y":0.7,"d":18},
    {"x":0.6,"y":0.4,"d":25},{"x":0.6,"y":0.6,"d":30},
    {"x":0.7,"y":0.3,"d":6},{"x":0.7,"y":0.5,"d":18},{"x":0.7,"y":0.7,"d":8},
    {"x":0.8,"y":0.4,"d":4},{"x":0.8,"y":0.6,"d":5},
    {"x":0.9,"y":0.5,"d":1}
  ]},
  "mark":{"type":"rect"},
  "encoding":{
    "x":{"field":"x","type":"quantitative","bin":{"maxbins":12},"title":"Length (own → opp)"},
    "y":{"field":"y","type":"quantitative","bin":{"maxbins":8},"title":"Width"},
    "color":{"field":"d","type":"quantitative","scale":{"scheme":"plasma"},"title":"Touches"}
  },
  "width":500,"height":300
}