Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort barchart columns [Feature Request] #231

Open
DanielPascoe opened this issue Oct 26, 2022 · 2 comments
Open

Sort barchart columns [Feature Request] #231

DanielPascoe opened this issue Oct 26, 2022 · 2 comments

Comments

@DanielPascoe
Copy link

DanielPascoe commented Oct 26, 2022

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

@mjwebster
Copy link

I would also like this feature!

@pvictor
Copy link
Member

pvictor commented May 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants