diff --git a/R/coord-.r b/R/coord-.r index 17fb57602f..ce60824963 100644 --- a/R/coord-.r +++ b/R/coord-.r @@ -87,6 +87,8 @@ Coord <- ggproto("Coord", is_linear = function() FALSE, + # Does the coordinate system support free scaling of axes in a faceted plot? + # Will generally have to return FALSE for coordinate systems that enforce a fixed aspect ratio. is_free = function() FALSE, setup_params = function(data) { diff --git a/R/sf.R b/R/sf.R index 9d1e45cb3e..e8e87e0e37 100644 --- a/R/sf.R +++ b/R/sf.R @@ -353,6 +353,9 @@ CoordSf <- ggproto("CoordSf", CoordCartesian, ) }, + # CoordSf enforces a fixed aspect ratio -> axes cannot be changed freely under faceting + is_free = function() FALSE, + aspect = function(self, panel_params) { if (isTRUE(sf::st_is_longlat(panel_params$crs))) { # Contributed by @edzer