0

I need to add a scale bar to a global map made in ggplot2 in R, and the easiest way seemed to be via the ggsn package.

But the scale bar doesn't look right when I eyeball the map - e.g., it's ~4000km across Australia E-W, and a bit less than that across Africa at the equator. The 2000km scale bar looks wider than Africa at the equator and almost as wide as Australia.

Thanks for your thoughts!

Reproducible code:

library(ggplot2)
library(ggsn)
library(dplyr)

GG.GlobalMap = map_data("world") %>%
  filter(region != "Antarctica")

ggplot(GG.GlobalMap, aes(long, lat, group = group)) +
  geom_path(color = "black") +
  scalebar(data = GG.GlobalMap, dist = 1000, dd2km = TRUE, model = "WGS84",
           st.size = 3, location = "bottomright") +
  theme_void()
Community
  • 1
  • 1
Helen S
  • 49
  • 5
  • A scale bar is pretty meaningless on a global map drawn in lat-long projection, because distances are highly distorted with latitude. better would be to draw a graticule, which is the preferred method for such maps. If you really want a scale bar, then use a projection that closely preserves distances. see e.g. https://en.wikipedia.org/wiki/List_of_map_projections – dww Dec 29 '16 at 01:01
  • also relevant: https://blogs.esri.com/esri/arcgis/2010/04/21/back-to-the-issue-of-scale-bars/ – dww Dec 29 '16 at 01:17
  • Yes, that's why I also included the example of Africa along the equator - the distance doesn't seem to match there either. – Helen S Dec 29 '16 at 03:41

1 Answers1

4

In the simple lat-long projection you are using, distances are distorted with latitude, becoming progressively stretched as they get closer to the poles. At the poles, a single point is stretched out to the full width of the rectangular map. As a result, it is not recommended to use scale bars on such maps, because their size would only be correct at a specific latitude, and is misleading everywhere else on the map. We can see this in action by plotting a series of scale bars at various latitudes, to show how they vary in size:

ggplot() +
  geom_path(data = map_data("world"), aes(long, lat, group = group), color = "grey80") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -80, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -60, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -40, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = -20, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 0, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 20, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 40, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 60, y.max = 90, x.min = -180, x.max = 180,  st.size = 2, location = "bottomright") +
  scalebar(dist = 1000, dd2km = TRUE, model = "WGS84", y.min = 80, y.max = 90, x.min = -180, x.max = 180, st.size = 2, location = "bottomright") +
  theme_void()

enter image description here

For this reason, it is usually recommended to use a graticule rather than scale bars on small scale global maps.

ggplot() +
  geom_path(data = map_data("world"), aes(long, lat, group = group), color = "black") +
  scale_x_continuous(breaks = (-9:9)*20) +
  scale_y_continuous(breaks = (-9:9)*10) +
  theme_bw() +
  theme(panel.grid.major = element_line(colour = 'grey50', size = 0.3, linetype = 3))

enter image description here

If you really want to use a scale bar, you should first reproject your data (using spTransform) to an equal-area projection, for which distances are distorted only minimally or not at all.

dww
  • 30,425
  • 5
  • 68
  • 111
  • Thanks for this explanation - I wrongly assumed the scale bar size would match the distance at the equator. – Helen S Dec 29 '16 at 16:55