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

plot legend order #237

Open
joe-jhou2 opened this issue May 10, 2022 · 1 comment
Open

plot legend order #237

joe-jhou2 opened this issue May 10, 2022 · 1 comment

Comments

@joe-jhou2
Copy link

Does any parameter control legend order? When showing clusters, the legend order is so random, can be 1 3 2 7 4 6 5. I cannot get why it happens and how to organize it.

@RubD
Copy link
Collaborator

RubD commented May 11, 2022

If the plot is a ggplot object, which is true for most 2D plots, then the ggplot object can be returned and updated using ggplot language. In that case you need to set return_plot = TRUE and save the plot to a variable, like for example myplot <- spatPlot2D. Ggplot offers ways to control legend order etc. However, in my opinion, it's typically easier (and faster) to do this outside of R.

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

2 participants