[R] labels on map

Mulholland, Tom Tom.Mulholland at dpi.wa.gov.au
Tue May 31 02:42:09 CEST 2005


What makes you think that there is a ylab parameter?

> args(map)
function (database = "world", regions = ".", exact = FALSE, boundary = TRUE, 
    interior = TRUE, projection = "", parameters = NULL, orientation = NULL, 
    fill = FALSE, col = 1, plot = TRUE, add = FALSE, namesonly = FALSE, 
    xlim = NULL, ylim = NULL, wrap = FALSE, resolution = if (plot) 1 else 0, 
    type = "l", bg = par("bg"), mar = c(0, 0, par("mar")[3], 
        0.1), border = 0.01, ...) 
NULL
>

Just because there are ellipses does not mean that ylab is an appropriate parameter. If you type map you'll see the function. Go looking for where the ellipses are used and you find

polygon(coord, col = col, ...)
lines(coord, col = col, type = type, ...)

So how why would these functions take a ylab parameter, they are for use within a plot. You have to remember that each function will only do what the author has programmed it to do.

So if you need to put a label somewhere you could always use mtext(side = 2,line = 1,"A label on side 2")

Tom

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of jose silva
> Sent: Tuesday, 31 May 2005 8:12 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] labels on map
> 
> 
> 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
> 
> j. silva
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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
>




More information about the R-help mailing list