Altair has the ability to resolve each axes' scale independently:
import altair as alt
import pandas as pd
# Sample data
data = {
'Group': ['A', 'A', 'A', 'B', 'B', 'B', 'C', 'C', 'C'],
'Category': ['A1', 'A2', 'A3', 'B1', 'B2', 'B3', 'C1', 'C2', 'C3'],
'Value': [10, 15, 7, 8, 12, 18, 12, 10, 9]
}
df = pd.DataFrame(data)
# Create the grouped bar chart
chart = alt.Chart(df).mark_bar().encode(
x=alt.X('Category:N', title='Category'),
y=alt.Y('Value:Q', title='Value'),
column=alt.Column('Group:N', title='Group')
)
chart.resolve_scale(x='independent')