In my use of the newer version of ggplot2 (version3.5.1), I found that I can't set the position for guide_colorstep individually, but only through the global theme's legend.position.
I'm not sure if this is intentional or not, but I think it doesn't follow the logic of guides as a whole. Here's a simple example:
library(ggplot2)
# position not working of guide_colorsteps
p1 <- ggplot(mpg, aes(displ, hwy, colour = cty)) +
geom_point() +
guides(color=guide_colorsteps(position = "bottom"))
# position working of guide_colorbar
p2 <- ggplot(mpg, aes(displ, hwy, colour = cty)) +
geom_point() +
guides(color=guide_colorbar(position = "bottom"))
# global theme’s legend.position setting
p3 <- ggplot(mpg, aes(displ, hwy, colour = cty)) +
geom_point() +
guides(color=guide_colorsteps()) +
theme(legend.position = "bottom")
patchwork::wrap_plots(p1, p2, p3)
In my use of the newer version of ggplot2 (version3.5.1), I found that I can't set the
position
forguide_colorstep
individually, but only through the global theme'slegend.position
.I'm not sure if this is intentional or not, but I think it doesn't follow the logic of
guides
as a whole. Here's a simple example: