library(maptools) jpn <- read.shape("./japan_ver61.shp") jpndata <- jpn$att.data jpnpoly <- Map2poly(jpn,region.id=attr(jpn,"region.id")) jpnxy <- get.Pcent(jpn) gunmadata <- subset(jpndata,jpndata$PREF=="ŒQ”nŒ§") gunmapoly <- subset(jpnpoly,jpndata$PREF=="ŒQ”nŒ§") x <- subset(jpnxy[,1],jpndata$PREF=="ŒQ”nŒ§") y <- subset(jpnxy[,2],jpndata$PREF=="ŒQ”nŒ§") aged <- read.delim("./agedprop.txt") gunmadata <- merge(aged,gunmadata,sort=F,by="JCODE") DD <- gunmadata$AP2006 classes <- cut(DD,seq(min(DD),max(DD),length=5),include.lowest=T) cols <- topo.colors(4) par(family="Japan1GothicBBB",las=1) plot(gunmapoly,col=cols[ordered(classes)],xlab="",ylab="",axes=F) legend(max(x)-0.3*(max(x)-min(x)),min(y)+0.1*(max(y)-min(y)), legend=names(table(classes)),cex=0.6,fill=cols) title("ŒQ”nŒ§Žs’¬‘º‚Ì65ΈÈã‚—îŽÒŠ„‡‚S‹æ•ªi2006”Nj") text(x,y,gunmadata$CITY1,cex=0.5,pos=1,offset=0)