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

Support color mapping for continuous variable in scatter plots #505

Open
Ductmonkey opened this issue Aug 7, 2024 · 0 comments
Open

Support color mapping for continuous variable in scatter plots #505

Ductmonkey opened this issue Aug 7, 2024 · 0 comments

Comments

@Ductmonkey
Copy link

Ductmonkey commented Aug 7, 2024

GGpairs supports mapping color to categorical variables but it seems not for continuous variables. This could make the visualization much more powerful to help expose 3-dimensional correlations (or lack thereof).

Is it possible to allow this for panels where it would be sensible (i.e. scatter plot) and leave other panels black?

library(GGally)

# works fine for categorical variables
ggpairs(iris, columns = 1:4, aes(color = Species))

# fails on continuous variables
ggpairs(iris, columns = 1:4, aes(color = Sepal.Length))
#> Warning: The following aesthetics were dropped during statistical transformation: fill
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#>   the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#>   variable into a factor?
#> Error in ggally_statistic(data = data, mapping = mapping, na.rm = na.rm, : `mapping` color column must be categorical, not numeric

Created on 2024-08-06 with reprex v2.0.2

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

1 participant