Created
March 25, 2020 16:20
-
-
Save hawleylin/fe2f194f76dec1ad0031c8edec78b5fc to your computer and use it in GitHub Desktop.
Make another interesting plot using this data.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | |
"description": "Assignment 3rd graph", | |
"width": 400, | |
"height": 400, | |
"padding": 5, | |
"data": { | |
"url": "https://raw.githubusercontent.com/vda-lab/vda-lab.github.io/master/assets/station_366.json" | |
}, | |
"transform": [ | |
{"calculate": "2011-datum.birthyear", "as": "age"}, | |
{"filter": | |
{ | |
"and": [{"field": "gender", "gt": 0}, {"field": "age", "lt": 80}] | |
} | |
} | |
], | |
"mark": {"type": "bar", "cornerRadiusTopLeft": 3, "cornerRadiusTopRight": 3}, | |
"encoding": { | |
"x": { | |
"field": "age", | |
"bin": {"maxbins": 40}, | |
"type": "quantitative" | |
}, | |
"y": { | |
"field": "tripduration", | |
"aggregate": "count", | |
"type": "quantitative" | |
}, | |
"color": {"field": "gender", "type": "nominal"} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment