Closed
Description
Line sizes in themes are generally provide in units of mm and converted to grid units by multiplication by .pt
. However, coord_sf()
doesn't do that, it uses the value of size
directly. Reprex:
library(ggplot2)
df <- data.frame(x = c(1, 2, 3), y = c(1, 2, 3))
p <- ggplot(df, aes(x, y)) + geom_point()
cowplot::plot_grid(
p + coord_fixed() + theme(panel.grid.minor = element_blank()) +
ggtitle("coord_fixed()"),
p + coord_sf() +
ggtitle("coord_sf() default"),
p + coord_sf() + theme(panel.grid = element_line(size = 0.5*.pt)) +
ggtitle("coord_sf() theme adjusted"),
nrow = 2
)
Created on 2018-11-09 by the reprex package (v0.2.1)
The offending lines are here:
Lines 576 to 582 in 6786969
The fix is simple, but it would affect the visual appearance of a lot of plots out in the wild.
Metadata
Metadata
Assignees
Labels
No labels