-
Notifications
You must be signed in to change notification settings - Fork 27
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
Normalized density for facetted plots #1
Comments
Yes it would make sense in some cases! I wouldn't want to make this the default behavior because I think raw neighbor counts are a bit more intuitive than relative ones, but for facetted plots I see how it can be useful. Maybe something like |
Returning a computed stat would bring the function's behavior inline with other ggplot2 functions (i.e. # Example
library(ggplot2)
library(ggpointdensity)
ggplot(diamonds, aes(carat, price)) +
geom_pointdensity(aes(color = stat(r_neighbors))) I feel # Example
# Default method would be 'nn'
ggplot(diamonds, aes(carat, price)) +
geom_pointdensity(aes(color = stat(ndensity)), method = "nn")
# kernel-density
ggplot(diamonds, aes(carat, price)) +
geom_pointdensity(aes(color = stat(ndensity)), method = "bkde2d")
# binned kernel-density
ggplot(diamonds, aes(carat, price)) +
geom_pointdensity(aes(color = stat(ndensity)), method = "bkde2d") |
This is already the case. ggplot(dat, aes(x = x, y = y, color = stat(n_neighbors) / max(n_neighbors))) +
geom_pointdensity() +
scale_color_viridis() I could tweak the Regarding your last suggestion with |
This was implemented in @bjreisman's recent pull request #8 , so I'm closing. |
Would it make sense to create a computed statistic to show the normalized/relative number of neighbors per group to the max nearest neighbors?
The text was updated successfully, but these errors were encountered: