Ordering boxplot x-axis in seaborn
<p>My dataframe <code>round_data</code> looks like this:</p>
<pre><code>      error                         username                    task_path
0      0.02  n49vq14uhvy93i5uw33tf7s1ei07vngozrzlsr6q6cnh8w...    39.png
1      0.10  n49vq14uhvy93i5uw33tf7s1ei07vngozrzlsr6q6cnh8w...    45.png
2      0.15  n49vq14uhvy93i5uw33tf7s1ei07vngozrzlsr6q6cnh8w...    44.png
3     0.25  xdoaztndsxoxk3wycpxxkhaiew3lrsou3eafx3em58uqth...    43.png
...     ...                                                ...       ...
1170  -0.11  9qrz4829q27cu3pskups0vir0ftepql7ynpn6in9hxx3ux...    33.png
1171   0.15  9qrz4829q27cu3pskups0vir0ftepql7ynpn6in9hxx3ux...    34.png


[1198 rows x 3 columns]
</code></pre>
<p>I want to have a boxplot showing the error of each user sorted by their average performance. What I have is:</p>
<pre><code>ax = sns.boxplot(
    x='username', 
    y='error', 
    data=round_data,
    whis=np.inf,
    color='c',
    ax=ax
)
</code></pre>
<p>which results into this plot:
<a href="https://i.stack.imgur.com/5yY0w.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5yY0w.png" alt="boxplot" /></a></p>
<p>How can I sort the x-axis (i.e., users) by mean error?</p>