Recreate a map chart from AFR
Share
The other day I was reading an article from AFR and noticed a nice map for a mining project, so I was wondering how can I create such a chart in R.
There are several aspects need to be noticed when trying to create this kind of map chart in R.
1. Part of the whole map
The original chart shows parts of Australian map, since the mining project is located in Western Australia (WA) and Northern Territory (NT). This can be achieved by creating the whole map first, then use coord_sf() function to limit the area of map to be shown.
2. Text labels
General location names
Text labels are shown by using location names at its latitude/longitude coordinates. To show some of the places in bold while others are shown in regular font, I used a column in my locations file to indicate that if this location name should be in bold, by using the ifelse() function.
Mining project name label
For the mining project, I was not able to reproduce an exactly same area as shown in the original chart since I do not have a shapefile or coordinates for the mining project, thus I use a dot to represent the mining site for demonstration.
For the mining project's name and highlighted text box, I adjusted parameters for the fill colour of the text label box (colour code: #C11516) with white text on it.
3. Full map and inset plot
You will notice that there's a smaller-sized map with a red rectangle to indicate the area of our chart and it's relative location of the whole Australian map. This can be done by 3 steps.
- create a full-sized map
- add a rectangle on the map, the rectangle is defined by using the coordinates restraints that we used to create the initial map (only showing parts of WA and NT)
- then use ggdraw() function to draw the first map in full size, and the second map in a smaller scale.
4. Map scale
Map scale can be added by using annotation_scale() function. Please note that this is an approximate scale.
R script can be viewed below: