Skip to content

Commit 44a6355

Browse files
committed
Fix geom_sf() break positions
1 parent 6b5395d commit 44a6355

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

R/ggplotly.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,11 @@ gg2list <- function(p, width = NULL, height = NULL,
668668
"\\*\\s+degree[ ]?[\\*]?", "&#176;",
669669
gsub("\"", "", tickData[["degree_label"]])
670670
)
671-
rng[[paste0(xy, ".major")]] <- tickData[[paste0(xy, "_start")]]
671+
# Downstream logic expects the 'break positions' to be on 0-1 scale
672+
# (which is then rescaled back to the data scale)
673+
rng[[paste0(xy, ".major")]] <- scales::rescale(
674+
tickData[[paste0(xy, "_start")]]
675+
)
672676

673677
# If it doesn't already exist (for this panel),
674678
# generate graticule (as done in, CoordSf$render_bg)

0 commit comments

Comments
 (0)