{ "height": 300, "data": { "url": "https://vega.github.io/vega-lite/data/movies.json" }, "width": 300, "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "layer": [ { "mark": { "opacity": 0.3, "type": "point", "filled": true }, "encoding": { "x": { "field": "Rotten_Tomatoes_Rating", "type": "quantitative" }, "y": { "field": "IMDB_Rating", "type": "quantitative" } } }, { "transform": [ { "as": [ "Rotten_Tomatoes_Rating", "ly" ], "loess": "IMDB_Rating", "on": "Rotten_Tomatoes_Rating" } ], "mark": { "color": "firebrick", "type": "line" }, "encoding": { "x": { "field": "Rotten_Tomatoes_Rating", "type": "quantitative" }, "y": { "field": "ly", "type": "quantitative" } } }, { "transform": [ { "as": [ "Rotten_Tomatoes_Rating", "ry" ], "regression": "IMDB_Rating", "on": "Rotten_Tomatoes_Rating" } ], "mark": { "color": "orange", "type": "line" }, "encoding": { "x": { "field": "Rotten_Tomatoes_Rating", "type": "quantitative" }, "y": { "field": "ry", "type": "quantitative" } } } ], "description": "How can we 'smooth' and rename data?" }