Skip to content

Commit

Permalink
Fixes #49 for coord_geo_polar
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Nov 30, 2023
1 parent 51ce2c7 commit 7c2903f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/coord_geo.R
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,10 @@ make_geo_scale <- function(self, dat, fill, color, alpha, pos,
}
dat$label[dat$name %in% skip] <- ""

# do this so ggsave gets the whole plot
old_plot <- last_plot()

Check warning on line 328 in R/coord_geo.R

View workflow job for this annotation

GitHub Actions / lint

file=R/coord_geo.R,line=328,col=15,[object_usage_linter] no visible global function definition for 'last_plot'
on.exit(set_last_plot(old_plot))

Check warning on line 329 in R/coord_geo.R

View workflow job for this annotation

GitHub Actions / lint

file=R/coord_geo.R,line=329,col=11,[object_usage_linter] no visible global function definition for 'set_last_plot'

# make ggplot of scale
gg_scale <- ggplot() +
geom_rect(
Expand Down
5 changes: 5 additions & 0 deletions R/coord_geo_polar.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ CoordGeoPolar <- ggproto("CoordGeoPolar", CoordPolar,
}
xmins <- cumsum(c(0, prop_list))

# do this so ggsave gets the whole plot
old_plot <- last_plot()
on.exit(set_last_plot(old_plot))

# assemble the timescale background as a ggplot
geo_scale <- ggplot()
for (ind in seq_along(dat_list)) {
geo_scale <- geo_scale +
Expand Down

0 comments on commit 7c2903f

Please sign in to comment.