[R] Adding Two-Headed Arrow in map legend
Miluji Sb
milujisb at gmail.com
Thu Apr 14 10:01:21 CEST 2016
Hello Jim,
You're amazing. This is what finally worked:
arrows(-1,19,35.6,19,code=3, xpd=T).
Don't know the coordinates were giving so much trouble. Maybe something to
do with maps in rworldmap. Thanks again!
Sincerely,
Milu
On Wed, Apr 13, 2016 at 6:51 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
> Hi Milu,
> My fault here. As I don't have the data to make the map and try out my
> suggestions I mixed up the x and y coordinates. Try this:
>
> par(xpd=TRUE)
> arrows(-19.75966,53,33.60000,53,code=3)
> par(xpd=FALSE)
>
> Jim
>
> On Tue, Apr 12, 2016 at 10:11 PM, Miluji Sb <milujisb at gmail.com> wrote:
> > Hello Jim,
> >
> > Thanks again. I am getting the two-headed arrow but I cannot seem to get
> the
> > coordinates right for the arrow to appear beneath the map. These
> coordinates
> > puts the arrow on the left hand side. Thanks again!
> >
> > Sincerely,
> >
> > Milu
> >
> > On Tue, Apr 12, 2016 at 1:15 PM, Jim Lemon <drjimlemon at gmail.com> wrote:
> >>
> >> Hi Milu,
> >> There is a two-headed arrow on the image you sent, and it seems to be
> >> where you specified. Did you want it beneath the map, as:
> >>
> >> par(xpd=TRUE)
> >> arrows(-22,54.75,-22,74,code=3)
> >> par(xpd=FALSE)
> >>
> >> Jim
> >>
> >> On Tue, Apr 12, 2016 at 7:58 PM, Miluji Sb <milujisb at gmail.com> wrote:
> >> > 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
> >
> >
>
[[alternative HTML version deleted]]
More information about the R-help
mailing list