I'm using ggplot2_4.0.1 and want to change the axis line theme. According to the documentation, I can use the axis.line.* elements.
However, this does not quite work as expected:
# this works: line is drawn as expected
ggplot(mtcars) +
geom_point(aes(x = hp, y = mpg)) +
theme(axis.line.y.left = element_line()) # same for axis.line.x.bottom
# this doesn't work: no line is shown on the right side
ggplot(mtcars) +
geom_point(aes(x = hp, y = mpg)) +
theme(axis.line.y.right = element_line()) # same for axis.line.x.top
# this doesn't work: lines on the top/right are documented to be interited, but aren't
ggplot(mtcars) +
geom_point(aes(x = hp, y = mpg)) +
theme(axis.line = element_line()) # same for axis.line.x, axis.line.y
