Dear bloggers,

I have been working with maps lately, and I am quite new to the environment.

What I want to do is obtain a main map of Spain mainland (spain.main) and
one selection for the canary islands (spain.canarias) that are made by
selection 51 and 52 and be coloured according to certain categories (this
case the value of PTFR in year 1960). When I plot nevertheless, the islands
are selected in the wrong category. What I came up with is to specify the
selection, which does not work either (they are left white). Any
suggestions?

spain.main <- spain[-c(51,52),]
spain.canarias <- spain[c(51,52),]
oldpar <- par(no.readonly = FALSE)
bins   =
seq(min(datav$PTFR[(datav$year==1960)&(datav$ORDER==11)]),max(datav$PTFR),
length= 4 )
colpal = brewer.pal(length(bins)-1,"YlOrRd")
lb       = 4
par(fig=c(0,1,0,1), new=TRUE)
par(mar=c(0,0,0,0))
plot(spain.main, col=colpal[-c(51,52)])
legend("bottomright",fill=colpal,legend=paste(round(bins[-length(bins)],2)

,"-",round(bins[-1],2)),cex=1, bg="white")
par(fig=c(0.02,0.2,00.02,0.2), new=TRUE)
plot(spain.canarias, col=colpal)
box()
text(0.1,0.95,"Colpal",cex=2)
text(rep(0.5,length(bins)-1), seq(0.1,0.8,length=length(bins)-1),
paste(bins[-length(bins)],"-",bins[-1]),cex=2)
text(0.5,0.95, "bins", cex=2)
bins     = quantile(datav$PTFR[(datav$year==1960)&(datav$ORDER==11)],
seq(0,1,length=lb))
par(oldpar)


Ale

	[[alternative HTML version deleted]]

