# AoG/Makie: Axis sorted in alphabetical order

**URL:** <https://discourse.julialang.org/t/aog-makie-axis-sorted-in-alphabetical-order/113527>\
**Category:** Visualization\
**Tags:** makie, algebraofgraphics\
**Created:** [April 26, 2024, 10:04am UTC](https://discourse.julialang.org/t/aog-makie-axis-sorted-in-alphabetical-order/113527 "2024-04-26T10:04:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gruemelmonster](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@gruemelmonster](https://discourse.julialang.org/u/gruemelmonster)\
**Post date:** [April 26, 2024, 10:04am UTC](https://discourse.julialang.org/t/aog-makie-axis-sorted-in-alphabetical-order/113527/1 "2024-04-26T10:04:21Z")

</div>

I am trying to plot some measurement data using AoG. I am also pretty new to this, so I might be missing something obvious.

When I try to plot data that has string entries as an X-Axis, the values get sorted by alphabetical order. Is there a way I can prevent this and simply print in the order of the original data?

A quick example:

```julia
using AlgebraOfGraphics
using CairoMakie
using DataFrames

df = DataFrame(Measurement=["Simulation", "N1", "N2", "N3", "N10", "N11"], Values=[140.00,134.76,133.80,132.00,135.23,134.79])

measurementdata = data(df[!,[:Measurement, :Values]]);
measurementmapping = mapping(:Measurement, :Values);
layer = visual(Scatter)
draw(layer * measurementdata * measurementmapping)

```

As a result I get:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/1/e10d45e0f047ce643af0a969440df3f8a0e4bece.png)

I would like to get the X-Axis in this order instead: Simulation, N1, N2, …, N10, N11

Does anyone know how to acheive this?

---

<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:** [April 26, 2024, 12:30pm UTC](https://discourse.julialang.org/t/aog-makie-axis-sorted-in-alphabetical-order/113527/2 "2024-04-26T12:30:09Z")

</div>

Apply a [sorter](https://aog.makie.org/stable/API/functions/#AlgebraOfGraphics.sorter) to the x values:

```julia
measurementmapping = mapping(:Measurement => sorter(df.Measurement), :Values);

```

---

<div class="post-metadata">

**Author:** ![gruemelmonster](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@gruemelmonster](https://discourse.julialang.org/u/gruemelmonster)\
**Post date:** [April 26, 2024, 12:39pm UTC](https://discourse.julialang.org/t/aog-makie-axis-sorted-in-alphabetical-order/113527/3 "2024-04-26T12:39:55Z")

</div>

Awesome! That did the trick. I do not yet understand exactly what it is doing, but I will look into that.

When searching I was looking for some option in the means of Sort=false…
