# How to use AlgebraOfgraphics's sorter

**URL:** <https://discourse.julialang.org/t/how-to-use-algebraofgraphicss-sorter/78030>\
**Category:** Visualization\
**Tags:** algebraofgraphics\
**Created:** [March 17, 2022, 2:16pm UTC](https://discourse.julialang.org/t/how-to-use-algebraofgraphicss-sorter/78030 "2022-03-17T14:16:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [March 17, 2022, 2:16pm UTC](https://discourse.julialang.org/t/how-to-use-algebraofgraphicss-sorter/78030/1 "2022-03-17T14:16:56Z")

</div>

It is not clear to me from the [sorter documentation](http://juliaplots.org/AlgebraOfGraphics.jl/stable/API/functions/#AlgebraOfGraphics.sorter) how to use the Algebra of Graphics’s sorter. My current attempt is:  
`plt *= mapping(marker=:l) |> sorter(Vector(1:13) .|> string)`

Anyone who knows how to use it?

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [March 17, 2022, 2:33pm UTC](https://discourse.julialang.org/t/how-to-use-algebraofgraphicss-sorter/78030/2 "2022-03-17T14:33:28Z")

</div>

Found it. My `:l` column consists of integers 1:13 converted to strings. The they become sorted when I do:  
`mapping(marker=:l=>sorter(Vector(1:13) .|> string))`

---

<div class="post-metadata">

**Author:** ![Jakob](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Post date:** [March 17, 2022, 2:35pm UTC](https://discourse.julialang.org/t/how-to-use-algebraofgraphicss-sorter/78030/3 "2022-03-17T14:35:40Z")

</div>

See also recent discussions about a potential redesign, e.g. [here](https://github.com/JuliaPlots/AlgebraOfGraphics.jl/issues/329) or [here](https://discourse.julialang.org/t/order-of-legend-entries-in-algebraofgraphics/77753/4).
