Skip to content

Commit 48a6325

Browse files
committed
use annotate() to avoid propagating labels
1 parent 7cd73d5 commit 48a6325

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

R/annotation-borders.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@
3535
annotation_borders <- function(database = "world", regions = ".", fill = NA,
3636
colour = "grey50", xlim = NULL, ylim = NULL, ...) {
3737
df <- map_data(database, regions, xlim = xlim, ylim = ylim)
38-
geom_polygon(aes(.data$long, .data$lat, group = .data$group), data = df,
39-
fill = fill, colour = colour, ..., inherit.aes = FALSE)
38+
annotate(
39+
geom = "polygon",
40+
x = df$long, y = df$lat, group = df$group,
41+
fill = fill, colour = colour, ...
42+
)
4043
}
4144

4245
#' @export

0 commit comments

Comments
 (0)