dreamRs/esquisse

Sort barchart columns [Feature Request]

Opened this issue · 2 comments

Default sort order for bar charts seems to be the order of the categorical column. Therefore if you have a data frame whose categorical data is in alphabetical order, the Y axis variable is unlikely to plot in descending (or ascending) numerical order.

Option to sort by a numeric value - general use case would be the numeric value of the column plotted in the bar chart Y axis, although sort on another column would also be a nice to have.

edit - something like + scale_x_discrete(limits = my_var) I presume is a straightforward syntax here

I would also like this feature!

Hello,

In last CRAN release of esquisse (v2.0.0) you can open a tool to reorder factor's levels via a button in the toolbar:

Click the "Update factor" button in the header :

esquisse-btn-reorderlevels

In the popup window you can rearrange levels by alphabetical or count order or drag and drop individual levels :

esquisse-update-levels

Then click "Update factor variable" button at the bottom of the window and the plot will update with new order :

esquisse-reordered

Victor