# Grouped Bar Plots

**URL:** https://discourse.julialang.org/t/grouped-bar-plots/129170
**Category:** Visualization
**Tags:** plots, statsplots, bar
**Created:** [May 20, 2025, 10:24am UTC](https://discourse.julialang.org/t/grouped-bar-plots/129170 "2025-05-20T10:24:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chelseas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chelseas/32/12148_2.png) [@chelseas](https://discourse.julialang.org/u/chelseas)
#### Post date: [May 20, 2025, 10:24am UTC](https://discourse.julialang.org/t/grouped-bar-plots/129170/1 "2025-05-20T10:24:13Z")

</div>

How do I get my grouped bar plot bars to be next to each other and not on top of each other?

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/a/0a1ab8582fcdbb7723389506bb03730a3e094998.png)

code pulling data from dataframe:  
plot\_vio = bar(  
categorical(analysis.type),  
analysis.val,  
group = categorical(string.(analysis.max\_val)),  
bar\_position= :dodge,  
bar\_width= 0.1,  
xlabel = “Type”,  
ylabel = “Val”,  
title = “Val by Type and max”,  
)

For each max val, there are multiple vals and a label of type

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [May 20, 2025, 3:27pm UTC](https://discourse.julialang.org/t/grouped-bar-plots/129170/2 "2025-05-20T15:27:40Z")

</div>

Have you looked at the StatsPlots.jl documentation under [groupedbar plots](https://docs.juliaplots.org/latest/generated/statsplots/#Grouped-Bar-plots)?

---

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [May 21, 2025, 9:47am UTC](https://discourse.julialang.org/t/grouped-bar-plots/129170/4 "2025-05-21T09:47:39Z")

</div>

In AoG it works like this I suppose:

> **[Dodging | AlgebraOfGraphics](https://aog.makie.org/stable/examples/scales/dodging#Dodging)**
>
> Documentation for AlgebraOfGraphics.jl
