You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rule is getting drawn as many times as the text, but it's less blurry than with the text since the geometry is simpler.
If we check the Vega-Lite gallery equivalent, this example doesn't have the duplicate draws problem
The issue can be resolved by aligning the Altair example with the Vega-Lite example using two nested layers. The first layer handles rectangles, binding to the inline data to draw one mark per row. The second layer binds to the rule and text marks, avoiding repeated drawing. Alternatively, the Vega-Lite example can be simplified to a single layer by inlining a one-row data object for the rule and text marks. See this example where I've made a minimal change to the Altair generated spec.
I'll leave it to the Altair core team to decide on doc updates, but this info should let you avoid unwanted repeat draws in new graphs. In short, marks that should only be drawn once should be bound to single-row datasets. Feel free to reach out in the VL repo if you have feedback on the nesting of layers in the public VL example.
What happened?
Related to this SO post. For this example on the documentation page:
The text "hazardous" on the plot looks blurry.
What would you like to happen instead?
I would like the
mark_text
font/weight to appear the same as the axis labels.Which version of Altair are you using?
5.5.0
The text was updated successfully, but these errors were encountered: