# Makie: Unable to position Legend

**URL:** https://discourse.julialang.org/t/makie-unable-to-position-legend/99769
**Category:** General Usage
**Tags:** question, plotting, makie
**Created:** [June 2, 2023, 12:43pm UTC](https://discourse.julialang.org/t/makie-unable-to-position-legend/99769 "2023-06-02T12:43:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![VictorSeven](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/victorseven/32/50437_2.png) [@VictorSeven](https://discourse.julialang.org/u/VictorSeven)
#### Post date: [June 2, 2023, 12:43pm UTC](https://discourse.julialang.org/t/makie-unable-to-position-legend/99769/1 "2023-06-02T12:43:42Z")

</div>

Hi all,

I am trying to get a figure done with Makie. I am having trouble setting the position of my legend so it does not intersect with the lines. I have checked [Legend · Makie](https://docs.makie.org/stable/examples/blocks/legend/) , but that only says that I can use combinations of left, center, right with top, center, bottom. I tried to feed a tuple of floats to the position argument and it seems to accept them, but the Legend does not appear to change its position, no matter which numbers I put. Also, the possibility of feeding tuples to the position argument is not documented anywhere, but it is discussed here: [Can you do fine adjustment on legend position in Makie?](https://discourse.julialang.org/t/can-you-do-fine-adjustment-on-legend-position-in-makie/88662)

My code is something like

`axislegend(axis, position=(0.1, 0.8), framevisible=false, rowgap=0, patchlabelgap=1, patchsize=(10,10)) `

What is the best way to fine-tune the Legend position with Makie? Thank you!

---

<div class="post-metadata">

### Author: ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)
#### Post date: [June 3, 2023, 6:16pm UTC](https://discourse.julialang.org/t/makie-unable-to-position-legend/99769/2 "2023-06-03T18:16:40Z")

</div>

The `position = (0.2, 0.8)` syntax works for me with CairoMakie 0.10.5  
MWE:

```julia
fig = Figure();
ax = fig[1,1] = Axis(fig);
lines!(ax, 1:10, 1:10; label = "x");
axislegend(ax, position = (0.5, 0.5));

```

Perhaps you are using a different backend or version?

---

<div class="post-metadata">

### Author: ![VictorSeven](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/victorseven/32/50437_2.png) [@VictorSeven](https://discourse.julialang.org/u/VictorSeven)
#### Post date: [June 13, 2023, 7:35pm UTC](https://discourse.julialang.org/t/makie-unable-to-position-legend/99769/3 "2023-06-13T19:35:40Z")

</div>

Hi, thank you for your answer, and sorry for the late reply.

To me, it seems that the problem is that the figure size I was working with was small (I am using the physical dimensions of the graph, 246.0pt of width). When I increase to two-columns, 510 pt, I could slightly position the legend. Is there any kind of autopositioning?

---

<div class="post-metadata">

### Author: ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)
#### Post date: [June 14, 2023, 7:21pm UTC](https://discourse.julialang.org/t/makie-unable-to-position-legend/99769/4 "2023-06-14T19:21:20Z")

</div>

I am not aware of an intelligent legend position argument that avoids overlapping data. I have come to prefer to place legends outside of the plots.
