Closed
Description
When attempting to change the axis position with guide_axis
it seems that the title is not correctly pulled unless manually specified.
library(ggplot2)
p <- ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
geom_point()
Currently you can swap the placement with scale_(x|y)_*(postion = ...)
pretty reliably
p + scale_x_continuous(position = "top")
But trying to swap scales with guides()
doesn’t seem to include the title
p + guides(x = guide_axis(position = "top"))
Even though the argument title = waiver()
it doesn’t seem to work. But works when manually set.
p + guides(x = guide_axis(position = "top", title = "test"))
Created on 2021-10-27 by the reprex package (v2.0.1)