Skip to content

theme: axis.line elements do not behave as documented #6777

@mschubert

Description

@mschubert

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
Image
# 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
Image
# 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
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions