Skip to content

Instantly share code, notes, and snippets.

@justinm0rgan
Created April 24, 2022 16:31
Show Gist options
  • Select an option

  • Save justinm0rgan/095a7c15fa7cc53be930be059ae8b264 to your computer and use it in GitHub Desktop.

Select an option

Save justinm0rgan/095a7c15fa7cc53be930be059ae8b264 to your computer and use it in GitHub Desktop.
Add north arrow and scale bar to plot using ggplot and ggspatial
# create plot
nyc_cd_market_comp_plot <- nyc_cd_market_plot +
annotation_scale(
location = "bl",
pad_x = unit(3, "cm")
) +
annotation_north_arrow(
location = "br",
pad_x = unit(0.5, "in"),
style = north_arrow_fancy_orienteering
) +
theme(panel.grid = element_line(color = "transparent"))
# save plot
ggsave("./images/nyc_cd_market_comp_plot.png", plot = nyc_cd_market_comp_plot)
# preview results
nyc_cd_market_comp_plot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment