Grouped bar charts with grid
See original GitHub issueI’m trying to produce a grouped bar chart, with horizontal grid lines turned on. Starting from the grouped bar chart example in the altair tutorials, I turned on the grid on the Y axis, as follows:
Chart(population, transform=t).mark_bar().encode(
X('gender:N', axis=False, scale=Scale(bandSize=6)),
Y('sum(people):Q', axis=Axis(grid=True)),
Color('gender:N', scale=Scale(range=["#FF9800", "#03A9F4"])),
Column('age:O', axis=Axis(orient='bottom'))
).configure(
facet=FacetConfig(cell=CellConfig(strokeWidth=0, height=250))
)
However, this causes the grid lines to be interrupted between groups. How can we make the grid lines go across group columns?
Thanks,
–nico
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Grid of clustered/grouped barplots - bioST@TS
In this tutorial, we will see how to make a grid of clustered/ grouped bar plots using facet_wrap() . Such a grid may...
Read more >Grouped bar charts with grid lines
I'm trying to produce a grouped bar chart, with horizontal grid lines turned on. Starting from the grouped bar chart example in the...
Read more >Grouped bar chart with labels — Matplotlib 3.6.2 documentation
This example shows a how to create a grouped bar chart and how to annotate bars with labels. ... The use of the...
Read more >Create a grouped bar plot in Matplotlib - GeeksforGeeks
A bar chart is a great way to compare categorical data across one or two dimensions. More often than not, it's more interesting...
Read more >Customize grid lines in D3 grouped bar chart - Stack Overflow
I am new with D3 and I am trying to build a grouped bar chart using D3. I need my grid lines on...
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 FreeTop 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
Top GitHub Comments
Use the
spacing
argument toconfigure_facet
; see https://altair-viz.github.io/gallery/us_population_over_time.htmlYou can set the
padding
attribute within the scale; for example:The result looks a bit different than yours because I didn’t apply any transform.