You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an issue against PR #3659, which is currently on hold pending the next minor ggplot2 release. I'm filing this so I won't forget. This should probably be fixed before the PR gets merged.
In a nutshell, in some cases coord_sf() encounters numeric issues when trying to calculate plot limits and errors out. This is fine, but the error message should inform the user how to work around this problem (by setting default_crs = NULL). Also, these numeric issues probably shouldn't arise when lims_method = "geometry_bbox", but I haven't checked this yet carefully. Reprex below.
library(sf)
#> Warning: package 'sf' was built under R version 3.6.2#> Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0
library(ggplot2)
grid<- st_sf(st_make_grid(what='polygons'))
# Robinson, works
ggplot(grid) + geom_sf() + coord_sf(crs= st_crs(54030))
# Mollweide, doesn't work, error message suggests two possible fixes
ggplot(grid) + geom_sf() + coord_sf(crs= st_crs(54009))
#> Error: Scale limits cannot be mapped onto spatial coordinates in `coord_sf()`.#> Consider setting `lims_method = "geometry_bbox"` or `default_crs = NULL`.# Mollweide, works
ggplot(grid) + geom_sf() +
coord_sf(crs= st_crs(54009), lims_method="geometry_bbox")
# Mollweide, works
ggplot(grid) + geom_sf() +
coord_sf(crs= st_crs(54009), default_crs=NULL)
This is an issue against PR #3659, which is currently on hold pending the next minor ggplot2 release. I'm filing this so I won't forget. This should probably be fixed before the PR gets merged.
In a nutshell, in some cases
coord_sf()
encounters numeric issues when trying to calculate plot limits and errors out. This is fine, but the error message should inform the user how to work around this problem (by settingdefault_crs = NULL
). Also, these numeric issues probably shouldn't arise whenlims_method = "geometry_bbox"
, but I haven't checked this yet carefully. Reprex below.Created on 2020-04-11 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: