# How to have multiple labelcolors in legend?

**URL:** https://discourse.julialang.org/t/how-to-have-multiple-labelcolors-in-legend/99745
**Category:** Visualization
**Tags:** question, makie, cairomakie
**Created:** [June 1, 2023, 9:38pm UTC](https://discourse.julialang.org/t/how-to-have-multiple-labelcolors-in-legend/99745 "2023-06-01T21:38:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Gianluca\_Fuwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gianluca_fuwa/32/46071_2.png) [@Gianluca\_Fuwa](https://discourse.julialang.org/u/Gianluca_Fuwa)
#### Post date: [June 1, 2023, 9:38pm UTC](https://discourse.julialang.org/t/how-to-have-multiple-labelcolors-in-legend/99745/1 "2023-06-01T21:38:06Z")

</div>

Hi,

is there a way to have to have more than one `:labelcolor` in a `Legend()` or `axislegend()`?  
Specifically in my case, I am trying to make each label be the same color as the line it represents, like

```julia
plt.legend(labelcolor='linecolor')

```

in PyPlot.

I have tried the following

```julia
using CairoMakie
x = 1:0.01:10
y1 = x.^2
y2 = x.^3
fig = Figure()
ax = Axis(fig[1, 1])
lines!(ax, x, y1, color = :blue, label = "blue")
lines!(ax, x, y2, color = :red, label = "red")
axislegend(ax, position = :lt, labelcolor = [:blue, :red])
fig

```

But it seems that `labelcolor` is only allowed to be a single color(?).  
Is there an easy way to do this or would I have to make a legend for each line and try to manually align them?

---

<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: [June 2, 2023, 5:04am UTC](https://discourse.julialang.org/t/how-to-have-multiple-labelcolors-in-legend/99745/2 "2023-06-02T05:04:49Z")

</div>

Maybe try `label = rich("blue", color = :blue)`
