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.
[Tex/LaTex] Drawing the map of Guinea, Liberia and Sierra Leone together
diagrams
Related Solutions
You can do it as follows. See the comments in the code for explanations:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{scope}[thick,font=\scriptsize]
% Axes:
% Are simply drawn using line with the `->` option to make them arrows:
% The main labels of the axes can be places using `node`s:
\draw [->] (-5,0) -- (5,0) node [above left] {$\Re\{z\}$};
\draw [->] (0,-5) -- (0,5) node [below right] {$\Im\{z\}$};
% Axes labels:
% Are drawn using small lines and labeled with `node`s. The placement can be set using options
\iffalse% Single
% If you only want a single label per axis side:
\draw (1,-3pt) -- (1,3pt) node [above] {$1$};
\draw (-1,-3pt) -- (-1,3pt) node [above] {$-1$};
\draw (-3pt,1) -- (3pt,1) node [right] {$i$};
\draw (-3pt,-1) -- (3pt,-1) node [right] {$-i$};
\else% Multiple
% If you want labels at every unit step:
\foreach \n in {-4,...,-1,1,2,...,4}{%
\draw (\n,-3pt) -- (\n,3pt) node [above] {$\n$};
\draw (-3pt,\n) -- (3pt,\n) node [right] {$\n i$};
}
\fi
\end{scope}
% The circle is drawn with `(x,y) circle (radius)`
% You can draw the outer border and fill the inner area differently.
% Here I use gray, semitransparent filling to not cover the axes below the circle
\path [draw=none,fill=gray,semitransparent] (+1,-1) circle (3);
% Place the equation into the circle:
\node [below right,gray] at (+1,-1) {$|z-1+i| \leq 3$};
\end{tikzpicture}
\end{document}
There is also the patterns
library which allows you to fill the circle with several different patterns, but personally I would prefer semi-transparent fillings.
an alternative with tikz
:
\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{positioning,
shadows,
shapes,
}
\begin{document}
\begin{tikzpicture}[
node distance = 0pt,
shorten <>/.style = {shorten >=#1, shorten <=#1},
box/.style = {%
minimum height=12mm, text width=24mm, align=center,
draw, semithick, fill=white, outer sep=0pt,
drop shadow},%
sum/.style={%
circle, draw, fill=white, drop shadow,
minimum size=6mm, inner sep=0pt, outer sep=0pt,
node contents={\huge$+$}},
A/.style = {single arrow, draw, minimum height=8mm,
single arrow head extend=1mm,
shape border rotate=#1, fill=white, outer sep=0pt,
node contents={}},
]
\node (n1) [A=0,label=left:{$f(x,y)$}];
\node (n2) [box,right=of n1] {Degradation\\ function\\$H$};
\node (n3) [A=0,right=of n2];
\node (n4) [sum,right=of n3];
\node (n5) [A=0,label=right:{$g(x,y)$},
right=of n4];
\node (n6) [A=90,label=right:{$\eta(x,y)$},
below=of n4];
right=of n4,
\end{tikzpicture}
\end{document}
Best Answer
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
This was done on Win 8.1 with Miktex (full installation) and R 3.1.2 with the maps and mapdata packages installed.
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.
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.