I have three issues with the boxplot:
- The formatting directive for the x-axis labels is not being taken into account.
- The boxplots don't seem "right".
- The outliers are not appearing in the boxplot. (But I could be doing something wrong.)
| license: mit | |
| height: 500 | |
| scrolling: yes | |
| border: yes | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- uploaded using vegawidget --> | |
| <script src="https://cdn.jsdelivr.net/npm/vega@4.2.0"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/vega-lite@3.0.0-rc6"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/vega-embed@3.19.2"></script> | |
| <link rel="stylesheet" type="text/css" href="vega-embed.css"> | |
| </head> | |
| <body> | |
| <div id="vis"></div> | |
| <script type="text/javascript"> | |
| const spec = "spec.json"; | |
| const opt = {"defaultStyle":true,"renderer":"canvas"}; | |
| vegaEmbed('#vis', spec, opt).then(function(result) { | |
| // access view as result.view | |
| }).catch(console.error); | |
| </script> | |
| </body> | |
| </html> |
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v3.json", | |
| "data": { | |
| "url": "https://vega.github.io/vega-datasets/data/seattle-weather.csv", | |
| "format": { | |
| "type": "csv" | |
| } | |
| }, | |
| "hconcat": [ | |
| { | |
| "mark": { | |
| "type": "boxplot", | |
| "extent": 1.5 | |
| }, | |
| "encoding": { | |
| "x": { | |
| "field": "date", | |
| "timeUnit": "month", | |
| "type": "ordinal", | |
| "axis": { | |
| "format": "%b" | |
| } | |
| }, | |
| "y": { | |
| "field": "temp_max", | |
| "type": "quantitative" | |
| } | |
| } | |
| }, | |
| { | |
| "mark": { | |
| "type": "point" | |
| }, | |
| "encoding": { | |
| "x": { | |
| "field": "date", | |
| "timeUnit": "month", | |
| "type": "ordinal", | |
| "axis": { | |
| "format": "%b" | |
| } | |
| }, | |
| "y": { | |
| "field": "temp_max", | |
| "type": "quantitative" | |
| } | |
| } | |
| } | |
| ] | |
| } |