# How to give proper order in xaxis during boxplot?

**URL:** <https://discourse.julialang.org/t/how-to-give-proper-order-in-xaxis-during-boxplot/99206>\
**Category:** New to Julia\
**Tags:** question, plotting\
**Created:** [May 22, 2023, 8:52am UTC](https://discourse.julialang.org/t/how-to-give-proper-order-in-xaxis-during-boxplot/99206 "2023-05-22T08:52:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 22, 2023, 9:32am UTC](https://discourse.julialang.org/t/how-to-give-proper-order-in-xaxis-during-boxplot/99206/4 "2023-05-22T09:32:12Z")

</div>

> [@How to adjust the X-axis order of boxplot with StatsPlots.jl](https://discourse.julialang.org/t/how-to-adjust-the-x-axis-order-of-boxplot-with-statsplots-jl/56065/9):
>
> Hi, @mkborregaard, I have no knowledge of internal details. But how about @df df boxplot(string.(:id), :value, fillalpha=0.75, linewidth=1, xorder=[3, 17, 21]) Or we may pass into a custom sort function to sort the specific column in a df. @df df boxplot(string.(:id), :value, fillalpha=0.75, linewidth=1, xsort=sort) The above two lpad and sprintf workarounds work well for this particular example. But what if I want the order to be 21 3 17? Of course, I can still fi…

---

_[View the full topic](https://discourse.julialang.org/t/how-to-give-proper-order-in-xaxis-during-boxplot/99206)._
