An example of the code used for the main graph is presented below, and an example of the graph is on the next slide.
library(dplyr);library(ggplot2);library(rnaturalearth)
minX <- 4000000;maxX <- 6000000
worldcities<-read.csv("worldcities_comma.csv",sep=";")
wc<-worldcities;wc$lat<-gsub(",",".",wc$lat);wc$lng<-gsub(",",".",wc$lng)
wc<-transform(wc,lat=as.numeric(lat),lng=as.numeric(lng))
wccap<-filter(wc,capital=="primary")
caps<-filter(wccap,population>minX & population<maxX)
xlab <- "Longitude";ylab <- "Latitude";main <- "Latitude and Longitude of the World Capitals within the selected population range";leg<- "right";lab_sz<- 4
spdf_world <- ne_countries()
world<-fortify(spdf_world)
g<-ggplot(world,aes(long,lat))
g<- g+geom_polygon(aes(group = group), colour = "grey50", fill = NA) +
coord_quickmap()
g<-g+theme_bw()
g<-g+geom_point(data=caps,mapping=aes(x=lng,y=lat,color=city,size=population,alpha=1/3))
g<-g+theme(legend.position="none")
g<-g+ scale_x_continuous(limits = c(-180, 180))+scale_y_continuous(limits = c(-90, 90))+ labs(x=xlab,y=ylab,title=main,subtitle="Source: https://simplemaps.com/data/world-cities , as of August 2018")+ guides(color=guide_legend("Country"))
g<-g+theme(plot.title = element_text(hjust = 0.5,size=20.25)) +theme(plot.subtitle=element_text(size=16, hjust=0.5, face="italic", color="blue"))
g<-g+geom_text(data=caps,aes(x=lng,y=lat,label=city
) ,hjust=0.5, vjust=-1,size=lab_sz
)