Forum Discussion
sdrljaca
3 years agoFrequent Visitor
Deneb: Packing instead of Overlapping Bubbles in Scatter Plot
Hi, I am learning Deneb and Vega-Ligt and I love it. But bubbles are overlaping and I can not make bubbles Packing (as it is called in Charticulator). How? Thank you!
Adamboer
3 years agoResponsive Resident
To avoid overlapping bubbles in Deneb and Vega-Lite, you can use the "point" mark and set the "size" encoding to a fixed value or a calculated value based on your data. Additionally, you can set the "opacity" encoding to a lower value to make overlapping bubbles more transparent and distinguishable.
Here is an example of how to set up a basic bubble chart in Vega-Lite:
{
"mark": "point",
"encoding": {
"x": {"field": "x_value", "type": "quantitative"},
"y": {"field": "y_value", "type": "quantitative"},
"size": {"field": "size_value", "type": "quantitative"},
"opacity": {"value": 0.7}
}
}
You can adjust the "size" encoding to suit your needs, and you can also add other encodings like color or shape to further distinguish between bubbles.