#M6.9(データはUSGSより)以上 大きさに合わせてサイズを変化、深さで色分け(透過色) for (i in 1:nrow(eqdata)){ if (eqdata$depth[i]<=20) { eqdata$col[i] <- rgb(1,0,0,0.8)} if (eqdata$depth[i] > 20 && eqdata$depth <= 50) { eqdata$col[i] <- rgb(0,1,0,0.8)} if (eqdata$depth[i] > 50&& eqdata$depth <= 300) { eqdata$col[i] <- rgb(0,0,1,0.8)} if (eqdata$depth[i] > 300) { eqdata$col[i] <- rgb(1,0,1,0.8)} } #png("japaneq02.png",width=1000,height=800) par(family="Takao P明朝",ps = 18) map('worldHires', xlim=c(60,180), ylim=c(10,65),fill=T,col="lightgray") points(eqdata$longitude,eqdata$latitude,pch=16,cex =eqdata$mag-5.9, col=eqdata$col) points(in_service$longitude,in_service$latitude,pch=17,cex =2, col="darkorchid") points(under_construction$longitude,under_construction$latitude,pch=17,cex =2, col="darkorange") map.axes() title(main="Earthquake M>=6.9 (1900~2015/5/4) & Nuclear power stations") legend("bottomright",legend = c("In Service","Under Construction","Earthquake","深度0~20km","深度20~50km","深度50~300km","深度300km~"), cex=1,pch=c(17,17,16,16,16,16,16),col=c("darkorchid","darkorange","white",rgb(1,0,0),rgb(0,1,0),rgb(0,0,1),rgb(1,0,1)),bg="white") #dev.off()
|