Small non-zero values for size scale are not visible
See original GitHub issueIn Vega-Lite 2.x, if you encode a quantity with size and that quantity has elements with value zero, those points do not appear on the plot with the default scale:
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"url": "https://vega.github.io/vega-datasets/data/seattle-weather.csv"
},
"encoding": {
"color": {
"field": "weather",
"type": "nominal"
},
"size": {
"field": "precipitation",
"type": "quantitative"
},
"x": {
"field": "temp_min",
"type": "quantitative"
},
"y": {
"field": "temp_max",
"type": "quantitative"
}
},
"mark": "point"
}
In Vega-Lite 1.x, this was not the case; here’s the result of the above spec with VL1:
In VL2, you can fix this by setting the size scale domain to start at a negative number:
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"url": "https://vega.github.io/vega-datasets/data/seattle-weather.csv"
},
"encoding": {
"color": {
"field": "weather",
"type": "nominal"
},
"size": {
"field": "precipitation",
"type": "quantitative",
"scale": {"domain": [-1, 50]}
},
"x": {
"field": "temp_min",
"type": "quantitative"
},
"y": {
"field": "temp_max",
"type": "quantitative"
}
},
"mark": "point"
}
I think that silently hiding valid data should be considered a bug, and that the domain should default to something like what is in the final panel.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
How to suppress 0 values in an Excel chart - TechRepublic
Uncheck the Show a zero in cells that have zero value option (as shown in Figure C). Click OK.
Read more >Text displays too large in paper space in AutoCAD
Issue: Text objects in an AutoCAD drawing are blown up or scaled much larger than expected when displayed in a layout, in a...
Read more >Measurements and Error Analysis - WebAssign
Failure to zero a device will result in a constant error that is more significant for smaller measured values than for larger ones....
Read more >Using Effect Size—or Why the P Value Is Not Enough - NCBI
In this paper, we target readers with little or no statistical background in ... different scales so no direct comparison is possible; or...
Read more >Surpress Zero values in Charts - Microsoft Power BI Community
Thanks guys. I tried the "show item with no data" but didn't work. I think it is because there are data but the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Something like
Yes, you can add production rule, instead of making scale inaccurate.