# Change legend entries order in Plots.jl

**URL:** <https://discourse.julialang.org/t/change-legend-entries-order-in-plots-jl/101927>\
**Category:** General Usage\
**Tags:** plotting, plots\
**Created:** [July 22, 2023, 2:30pm UTC](https://discourse.julialang.org/t/change-legend-entries-order-in-plots-jl/101927 "2023-07-22T14:30:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![teob](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/teob/32/33609_2.png) [@teob](https://discourse.julialang.org/u/teob)\
**Post date:** [July 22, 2023, 2:30pm UTC](https://discourse.julialang.org/t/change-legend-entries-order-in-plots-jl/101927/1 "2023-07-22T14:30:05Z")

</div>

Imagine having 6 series of data, labeled using the cardinal numbers. When I split the legend into two columns using `legendcolumns = 2` I get the following order:

1 2  
3 4  
5 6

Is there any way to get the following order?

1 4  
2 5  
3 6

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [July 22, 2023, 3:24pm UTC](https://discourse.julialang.org/t/change-legend-entries-order-in-plots-jl/101927/2 "2023-07-22T15:24:27Z")

</div>

Try something like:

```julia
using Plots
n = 7
m = (n+1)÷2
D = rand(10, n)
ix = [1:m (m+1):2*m]'[1:n]
plot(D[:,ix], label=string.((ix)'), legendcolumns=2)

```
