# Coloring boxplot groups in Makie

**URL:** <https://discourse.julialang.org/t/coloring-boxplot-groups-in-makie/62505>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [June 7, 2021, 9:47am UTC](https://discourse.julialang.org/t/coloring-boxplot-groups-in-makie/62505 "2021-06-07T09:47:34Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [June 7, 2021, 1:22pm UTC](https://discourse.julialang.org/t/coloring-boxplot-groups-in-makie/62505/7 "2021-06-07T13:22:32Z")

</div>

So, you could use [AlgebraOfGraphics](https://github.com/JuliaPlots/AlgebraOfGraphics.jl/) to generate the correct Makie boxplot as follows.

```julia
julia> using AlgebraOfGraphics, CairoMakie

julia> set_aog_theme!() # optional

julia> df = (x = rand(1:3, 1000), y = rand(1000), group = rand(1:2, 1000));

julia> plt = data(df) * mapping(:x, :y, color = :group => nonnumeric, dodge = :group => nonnumeric) * visual(BoxPlot);

julia> draw(plt)

```

 ![boxplot](https://global.discourse-cdn.com/julialang/original/3X/3/3/33ec096fabd516b25b2d6b85161e13dd9697e0e6.png)

Doing this plot directly with Makie is a bit clumsy at the moment, but I’m planning to make a PR to support passing a vector of colors (see examples with [violin](https://makie.juliaplots.org/dev/plotting_functions/violin.html), where this is already possible).

---

_[View the full topic](https://discourse.julialang.org/t/coloring-boxplot-groups-in-makie/62505)._
