You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
legend works with geom_tile when col then fill aesthetics added
library(tidyverse)
#legend works with geom_tileggplot2::faithfuld|>
head(10) |>
ggplot() +
geom_tile(aes(x=waiting, y=eruptions, col=density, fill=density))
legend does not work with geom_raster when col then fill aesthetics added
#legend does not work with geom_rasterggplot2::faithfuld|>
head(10) |>
ggplot() +
geom_raster(aes(x=waiting, y=eruptions, col=density, fill=density))
#> Warning in geom_raster(aes(x = waiting, y = eruptions, col = density, fill =#> density)): Ignoring unknown aesthetics: colour
Works if the order of aesthetics is fill then col, but not the other way around
library(tidyverse)
#legend works if aesthetic order is fill then colggplot2::faithfuld|>
head(10) |>
ggplot() +
geom_raster(aes(x=waiting, y=eruptions, fill=density, col=density))
#> Warning in geom_raster(aes(x = waiting, y = eruptions, fill = density, col =#> density)): Ignoring unknown aesthetics: colour
Good catch! From some brief experimentation, it seems to be dropped due to the legend key data having colour as the aesthetics name after merging fill and colour guides, which then is discarded by the guide_geom()/GuideColourbar$get_layer_key(). I think this should be fixed in the guide_merge()/GuideColourbar$merge() step.
legend works with geom_tile when col then fill aesthetics added
legend does not work with geom_raster when col then fill aesthetics added
Created on 2023-06-15 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: