Strip plot with custom axis tick labels
After using the numerical values to calculate the average rating, they are replaced by string labels.
View this example in the online editor
Vega-Lite JSON Specification
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "data/movies.json"
},
"mark": {"size": 80, "type": "circle"},
"encoding": {
"x": {
"aggregate": "mean",
"axis": {
"labelExpr": "datum.label == 0 ? 'Poor' : datum.label == 5 ? 'Neutral' : 'Great'",
"labelFlush": false,
"values": [0, 5, 10]
},
"field": "IMDB Rating",
"scale": {"domain": [0, 10]},
"title": null
},
"y": {"field": "Major Genre", "sort": "x", "title": null}
}
}