# Drawing the map of Guinea, Liberia and Sierra Leone together

I would like to ask if some could help me draw the maps of a portion of West Africa i.e. Guinea, Liberia and Sierra Leone using LaTeX? Thank you.

• Maybe... This question has a do-it-for-me flavour, which doesn't fit well on this site (or the SE model). Show us what you've done thus far before we can move forward together.
– Werner
Feb 25, 2015 at 17:28
• Follow the instructions in TeXample. Example: India map Feb 25, 2015 at 17:29
• I'm not sure LaTeX is the best tool for cartography. Feb 25, 2015 at 17:44
• Can you show us the map Feb 25, 2015 at 18:05
• Recommend you use R for this. See students.ncl.ac.uk/keith.newman/r/maps-in-r#countries If it must be done in LaTeX then you need to use the knitr package with R and LaTeX both installed. Feb 25, 2015 at 18:39

Here is the code and results for using R and LaTex with the R package knitr http://yihui.name/knitr/ . The maps are plotted from a polynomial database in mapdata. A pdf image is created which then is typeset using LaTeX. (lots of details omitted)

A couple of notes

1. This was done on Win 8.1 with Miktex (full installation) and R 3.1.2 with the maps and mapdata packages installed.

2. This is not the only way to plot maps using R. There are links for using googlemaps, geodata, etc. Simply search the web with "using R" maps country and browse.

3. If you go to http://www.r-bloggers.com/?s=maps you will have links to over 800 discussions and examples of using maps in R.

\documentclass[10pt,letterpaper]{article}
\begin{document}
Map of Guinea, Liberia, and Sierra Leone

<<>>=
### Reference:
###  https://www.students.ncl.ac.uk
###      /keith.newman/r/maps-in-r
###  http://stackoverflow.com/questions/22282713
###      /r-maps-package-how-to-draw-lines-between-cities-within-the-country

library(maps)
library(mapdata)
map('worldHires',c('Guinea','Liberia','Sierra Leone'))
points(-13.67847,9.537029,col=2,pch=18)
text(-13.67847,9.537029, "Conakry", pos = 1)
### points(longitude, latitude, color, symbol shape)
@
\end{document}


• Can you add a few explanations? Is this is stored (multipart) figure, or are the outlines stored in a library and actually typeset? Feb 25, 2015 at 20:12
• Looks a bit more detailed, but doesn't have the flair of chat.stackexchange.com/transcript/message/20250016#20250016 ;-) Feb 25, 2015 at 20:12
• Thanks in advance. I would like to add some names to it like Conakry being the capital of Guinea and other names. Could you do that too? Feb 25, 2015 at 20:24
• When I did my edit, I was unable to properly delimit the code as code. It appears that the use of imbedded R syntax confuses the system. Feb 25, 2015 at 22:22

You can consider using the getmap package. An example:

\documentclass{article}
\usepackage{getmap}
\usepackage{graphicx}

\begin{document}
\getmap [file=africa, mode=gm, type=terrain,xsize=500, ysize=500, scale=2, zoom=6]{Sierra Leone}
\includegraphics[width=9cm]{africa}
\end{document}


• Sorry for the bad formating. I'm posting from hospital via smart phone - no editor :-( Maybe, someone can edit the answer! Feb 26, 2015 at 13:57
• I added an example. Feb 26, 2015 at 16:19
• Wonderful work guys Feb 27, 2015 at 15:30

I'm away from my computer at the moment so this will be a sparse answer, but a more visual answer is to use QGIS and then export the map as a PDF and include it using \includegraphics{}

You can get qgis here: http://www.qgis.org/

From there just Google "shape file " open it in QGIS, set the coloring however you want, and use the print preparation dialogue to save the section you want to.

The advantage of qgis is that it's easier to include many layers of map data and then only export sections.

I used this with road, waterways, and outline data across three countries.

• I really appreciate your answer. Thank you. Feb 25, 2015 at 23:46
• @user28251 I appreciate what the other person is doing with R, I just wanted to provide a more approachable, GUI option! I recently did a project where I scanned old maps out of books and then georeferenced them in QGIS and then wrote my report in LaTeX, so it's a recent question for me.
– Ryan
Feb 25, 2015 at 23:56