Given a simple, faceted chart like:
import altair as alt
data = alt.Data(values = [
{ "category" : "a", "x" : 1, "y" : 2 },
{ "category" : "a", "x" : 2, "y" : 4 },
{ "category" : "b", "x" : 1, "y" : 3 },
{ "category" : "b", "x" : 2, "y" : 5 }
])
alt.Chart(data).mark_point().encode(x = "x:Q", y = "y:Q").facet(
row = "category:O"
)
How do you hide the top-level "category" title along the y axis (while keeping the "a" and "b" labels)?
You can set the title
property of the encoding to None
:
alt.Chart(data).mark_point().encode(x = "x:Q", y = "y:Q").facet(
row = alt.Row("category:O", title=None)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With