lon<-c(130.8,136) lat<-c(33.5,36) e <- extent(lon[1], lon[2], lat[1], lat[2]) rc <- crop(j, e) slope1 <- terrain(rc, opt = "slope") aspect1 <- terrain(rc, opt = "aspect") hill1 <- hillShade(slope1, aspect1, 40, 270) subeqdata<-subset(eqdata,longitude>=lon[1] & longitude<=lon[2] & latitude>=lat[1] & latitude<=lat[2] & mag>=-4) subeqdata1<-subset(subeqdata,mag<1) subeqdata2<-subset(subeqdata,mag>=1 & mag<3) subeqdata3<-subset(subeqdata,mag>=3) sortlist <- order(subeqdata3$mag) subeqdata3<- subeqdata3[sortlist,] head(subeqdata1);tail(subeqdata1) head(subeqdata2);tail(subeqdata2) head(subeqdata3);tail(subeqdata3) alpha=0.6 plot(hill1, col = grey(0:100/100), legend = FALSE, main = "",axes=F, box=F) plot(rc, col = terrain.colors(20, alpha = 0.3), add = TRUE) points(subeqdata1$longitude,subeqdata1$latitude,cex=(subeqdata1$mag+4)/2,col=rgb(1,0,0,alpha=alpha),pch=20) points(subeqdata2$longitude,subeqdata2$latitude,cex=(subeqdata2$mag+4)/2,col=rgb(0,1,0,alpha=alpha),pch=20) points(subeqdata3$longitude,subeqdata3$latitude,cex=(subeqdata3$mag+4)/2,col=rgb(0,0,1,alpha=alpha),pch=20) legend("topleft",title="Magnitude",legend = c("M<1",expression(paste(1<=M,"<3")),expression(M>=3)), cex=1,pch=c(20,20,20),col=c(rgb(1,0,0,alpha=1),rgb(0,1,0,alpha=1),rgb(0,0,1,alpha=1)), pt.cex =2,bg ="gray", x.intersp = 1, y.intersp =1) title(paste(date,"地震 (微小地震、極微小地震を含む)"))
|