-
Notifications
You must be signed in to change notification settings - Fork 25
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
Order of points #15
Comments
This is already possible now, using staged aesthetic mappings: library(ggplot2)
ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) +
ggpointdensity::geom_pointdensity(aes(color = after_stat(ndensity)), size=8) +
NULL ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) +
ggpointdensity::geom_pointdensity(aes(x= stage(Sepal.Width, after_stat = x[order(ndensity)]), y=stage(Sepal.Length, after_stat = y[order(ndensity)]), color = after_stat(sort(ndensity))), size=8) +
NULL Created on 2023-12-04 with reprex v2.0.2 But it might indeed be a good idea to make this the default. Although I like being able to control plotting order by data order, since a user could still control plotting ordering using above technique, I am in favor of this FR. |
I think this would be good as a default because it's pretty tricky to remember how to do this manually. |
+1 for ordering by density as default |
I am wondering if there is a way to re-order the points according to their density/n_neighbors. Often points with high-density are hidden behind points with lower density. Plots would look much "cleaner" if there would be a way to order points by increasing density. However, if I remember it correctly the order is pre-determined by the order within the underlying dataframe.
The text was updated successfully, but these errors were encountered: