Skip to content
Back to formatted view

Raw Message

Message-ID: <429BAFF5.9050602@stats.uwo.ca>
Date: 2005-05-31T00:29:41Z
From: Duncan Murdoch
Subject: labels on map
In-Reply-To: <4444dccc0b554860b26ffd234630135f@oninet.pt>

jose silva wrote:
> dear all:
> 
> Im trying to obtain maps on R, under mapdata library, but I cannot define the labels.
> Here is an example:
> 
> library(mapdata)
> map("worldHires", c("portugal","spain"),ylim=c(34,46),xlim=c(-14,3.5))
> axis(1,at=seq(-12,3,3))
> axis(2)
> 
> when I try the parameter xlab or ylab in axis, i get: 
> parameter "ylab" couldn't be set in high-level plot() function 
> 
> any suggestion?  thanks in advance for your always useful advices

Despite their names, x and y axis labels aren't really part of the axis, 
they're titles in the margins of the plot.  Use the title() function to 
set them.

You could probably also set them in map(), but I don't have it installed 
to check.  mtext() is another general purpose way to put text in the 
margins.

Duncan Murdoch