Re: [R] labels on map

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Tue 31 May 2005 - 10:29:41 EST

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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 31 10:35:23 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:16 EST