Closed robschick closed 2 years ago
Thanks for reporting! This won't work yet because guide_axis()
never made it to coord_sf()
, if I'm remembering correctly. Maybe use the labels
arg as a workaround?
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.1.1
library(ggspatial)
#> Warning: package 'ggspatial' was built under R version 4.1.1
df <- data.frame(lon = c(45.00001, 45), lat = c(-64.00001, -64))
ggplot(df, aes(lon, lat)) +
geom_spatial_point(crs = "OGC:CRS84") +
scale_x_continuous(labels = function(x) as.character(round(x, 2))) +
scale_y_continuous(labels = function(x) as.character(round(x, 2))) +
coord_sf(crs = "EPSG:3857")
Created on 2021-10-05 by the reprex package (v2.0.1)
That explains it! Thanks for the suggested work around
Hi Dewey - I was trying to use guides to minimize label overlap when faceting, but didn't see any change in behavior? Here's a quick reprex:
In either case the labels overlap. I've also experimented with check.overlap, and angle, but the behavior doesn't change. Any suggestions on if I'm doing this wrong?
here's my setup: