-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
documentationgood first issue ❤️good issue for first-time contributorsgood issue for first-time contributors
Description
In prior versions of ggplot2, geom_vline and geom_hline did not affect the x and y scales, which was/is still currently the documented behavior. However, as of 4.0.1 (and possibly earlier - I have not explicitly tested 4.0.0) these functions do affect the x and y scales. Note that geom_abline continues to behave as documented, e.g. it continues to not affect the x and y scales.
Here is the code to reproduce the bug:
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
p + geom_vline(xintercept = 5)
p + geom_vline(xintercept = 10) # affects scale
p + geom_hline(yintercept = 30)
p + geom_hline(yintercept = 60) # affects scale
p + geom_abline(slope = 1, intercept = 10)
p + geom_abline(slope = 1, intercept = 50) # does not affect scaleMetadata
Metadata
Assignees
Labels
documentationgood first issue ❤️good issue for first-time contributorsgood issue for first-time contributors