# Makie add manual legend

**URL:** https://discourse.julialang.org/t/makie-add-manual-legend/107821
**Category:** Visualization
**Tags:** makie
**Created:** [December 19, 2023, 3:02pm UTC](https://discourse.julialang.org/t/makie-add-manual-legend/107821 "2023-12-19T15:02:27Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [December 19, 2023, 4:27pm UTC](https://discourse.julialang.org/t/makie-add-manual-legend/107821/2 "2023-12-19T16:27:13Z")

</div>

If you have array-valued colors you currently have to build legends manually, unfortunately.

```julia
f, ax, bp = barplot(1:3, 2:4, color = [:red, :blue, :red])
Legend(f[1, 2], [PolyElement(color = :red), PolyElement(color = :blue)], ["A", "B"])
f

```

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/5/b/5bd7aa9cb004fc4a85fdcb5b62842233f06c8b90.png)

---

_[View the full topic](https://discourse.julialang.org/t/makie-add-manual-legend/107821)._
