# Using pre-sorted data and renaming the factor label at the same time

**URL:** <https://discourse.julialang.org/t/using-pre-sorted-data-and-renaming-the-factor-label-at-the-same-time/139460>\
**Category:** New to Julia\
**Tags:** makie, algebraofgraphics\
**Created:** [September 14, 2026, 6:59am UTC](https://discourse.julialang.org/t/using-pre-sorted-data-and-renaming-the-factor-label-at-the-same-time/139460 "2026-09-14T06:59:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [September 14, 2026, 6:59am UTC](https://discourse.julialang.org/t/using-pre-sorted-data-and-renaming-the-factor-label-at-the-same-time/139460/1 "2026-09-14T06:59:08Z")

</div>

I’d like to do what the title says, i.e. this:

```julia-auto
spec = data(df) *
    mapping(:countries => presorted, :some_value, color = :group) *
    visual(BarPlot, direction = :x)
fg = draw(spec)

```

while renaming the factor label to say “Country list”. Is this possible or do I need to make relabel the data frame?

Thanks!

---

<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:** [September 14, 2026, 1:51pm UTC](https://discourse.julialang.org/t/using-pre-sorted-data-and-renaming-the-factor-label-at-the-same-time/139460/2 "2026-09-14T13:51:34Z")

</div>

> [@mahmah](#):
>
> `:countries => presorted`

You mean `:countries => presorted => "some label"`?
