# Problem about Makie Legend

**URL:** https://discourse.julialang.org/t/problem-about-makie-legend/75064
**Category:** General Usage
**Tags:** plotting, makie
**Created:** [January 23, 2022, 12:59pm UTC](https://discourse.julialang.org/t/problem-about-makie-legend/75064 "2022-01-23T12:59:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aachener](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aachener/32/18112_2.png) [@aachener](https://discourse.julialang.org/u/aachener)
#### Post date: [January 23, 2022, 12:59pm UTC](https://discourse.julialang.org/t/problem-about-makie-legend/75064/1 "2022-01-23T12:59:06Z")

</div>

Hi, guys

I am trying to replicate the following code from the book Julia Data Science.

I got a problem when I wanted to add a legend for the chart of the `series()` part, and put it below the chart horizontally, not in the chart, which is the original code does using `axislegend()`.

I guess the problem is caused by the labels produced by `series()`. Please help me out. Thanks!

```julia
Random.seed!(123)
y = cumsum(randn(6, 6), dims = 2)

Random.seed!(13)
matrix = randn(20, 20)
xv = yv = LinRange(-3, 0.5, 20)

function demo_themes(y, xv, yv, matrix)
    fig, ax, plt = series(y;
        labels = ["$i" for i in 1:6],
        markersize = 10,
        colormap = :Set1,  
        figure = (;
            resolution = (600, 500)),
        axis = (;
            xlabel = "time (s)",
            ylabel = "Amplitude",
            title = "My Testing of Makie",
            titlesize = 30,
            xticklabelsize = 14,
            yticklabelsize = 14)
    )
    hmap = heatmap!(xv, yv, matrix;
        colormap = :Spectral_5)
    limits!(-3.1, 7.5, -6, 5.1)
   # Here I want to put some legend
   # such as
   # Legend(fig[2,1], ax, or something), but it does not work
    Colorbar(fig[1, 2], hmap)
    fig
end

demo_themes(y, xv, yv, matrix)

```

---

<div class="post-metadata">

### Author: ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)
#### Post date: [January 23, 2022, 7:46pm UTC](https://discourse.julialang.org/t/problem-about-makie-legend/75064/2 "2022-01-23T19:46:33Z")

</div>

This seems working:

```julia
Legend(fig[2,1], ax, orientation=:horizontal)

```
