[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    [R-sig-Geo] Fwd: wrong colour class for sub-map
From:       Alessandra Carioli <alessandracarioli () gmail ! com>
Date:       2013-04-22 13:52:44
Message-ID: CAK6730t0ePxXE2g2kPBcFQt=+VTMmU9Qa2pDFhKUYjqzJwGBKQ () mail ! gmail ! com
[Download RAW message or body]

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]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic