subeqdata<-subset(eqdata,longitude>=133.23 & longitude<=133.29 & latitude>=35.23 & latitude<=35.31) 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) depth_class <- factor(cut(subeqdata$depth,breaks =c(0,10,20,30,max(subeqdata$depth)), include.lowest=T, labels=c("0~10km","10~20km","20~30km","30km~"))) mag_class<-factor(cut(subeqdata$mag,breaks =c(-4,1,3,max(subeqdata$mag)),right=F), labels=c("[ ,1)","[1,3)","[3, )")) table(depth_class,mag_class) alpha=0.6 par(mfrow=c(1,2),mar=c(15,5,3,2)) plot(subeqdata1$longitude,-subeqdata1$depth,cex=(subeqdata1$mag+4)/20,col=rgb(1,0,0,alpha=alpha),las=1,pch=20, xlim=range(subeqdata$longitude),ylim=range(-subeqdata$depth),xlab="longitude",ylab="depth") points(subeqdata2$longitude,-subeqdata2$depth,cex=(subeqdata2$mag+4)/20,col=rgb(0,1,0,alpha=alpha),pch=20) points(subeqdata3$longitude,-subeqdata3$depth,cex=(subeqdata3$mag+4)/20,col=rgb(0,0,1,alpha=alpha),pch=20) par(xpd=T) legend(x=par()$usr[1]+0.01,y=par()$usr[3]-7,title="Magnitude",legend = c("M<1",expression(paste(1<=M,"<3")),expression(M>=3)), cex=1,pch=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,horiz=T) par(xpd=F) title(paste("震源:経度・深さ (",date,")"),cex.main=2) plot(subeqdata1$latitude,-subeqdata1$depth,cex=(subeqdata1$mag+4)/20,col=rgb(1,0,0,alpha=alpha),las=1,pch=20, xlim=range(subeqdata$latitude),ylim=range(-subeqdata$depth),xlab="latitude",ylab="depth") points(subeqdata2$latitude,-subeqdata2$depth,cex=(subeqdata2$mag+4)/20,col=rgb(0,1,0,alpha=alpha),pch=20) points(subeqdata3$latitude,-subeqdata3$depth,cex=(subeqdata3$mag+4)/20,col=rgb(0,0,1,alpha=alpha),pch=20) par(xpd=T) legend(x=par()$usr[1]+0.01,y=par()$usr[3]-7,title="Magnitude",legend = c("M<1",expression(paste(1<=M,"<3")),expression(M>=3)), cex=1,pch=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,horiz=T) par(xpd=F) title(paste("震源:緯度・深さ (",date,")"),cex.main=2) par(mfrow=c(1,1))
|