[R] Adding Two-Headed Arrow in map legend

Miluji Sb milujisb at gmail.com
Tue Apr 12 11:58:47 CEST 2016


Dear Jim,

Thanks again! I do want the arrows at the bottom (beneath the map). This is
what I am doing:

# Draw the map
eps_europe <- mapCountryData(n, nameColumnToPlot="eps_score", mapTitle="EPS
Score - Europe",colourPalette=colourPalette,
catMethod="fixedWidth", missingCountryCol = "white", mapRegion="Europe",
addLegend=FALSE)

# ISO3 codes on the map
text(n, labels="ISO3", cex=0.30)

# Obtain coordinates for the arrow
par('usr')

# -19.75966  54.75966  33.60000  71.40000

# Arrows
par(xpd=TRUE)
arrows(-19.75966,  54.75966,  33.60000,  71.40000,code=3)
par(xpd=FALSE)

As the output shows I cannot seem to get the correct coordinates for the
arrows. Thanks again.

Sincerely,

Milu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myplot.pdf
Type: application/pdf
Size: 116608 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20160412/d53f8072/attachment.pdf>


More information about the R-help mailing list