tokai=read.csv("./mapdata/tokai.csv") tonankai=read.csv("./mapdata/tonankai.csv") nankai=read.csv("./mapdata/nankai.csv") kasp=read.csv("./mapdata/kanto_eq.csv") tasp=read.csv("./mapdata/tokai_asperity.csv") trench=read.csv("./mapdata/trench.csv") trough<-data.frame(names=c("駿河トラフ","相模トラフ","南海トラフ","フィリピン海プレート","東海","東南海","南海"), longitude=c(138.9,140.2,136.5,136,138,136.8,134), latitude=c(33.8,34.4,32.5,30.7,34.5,34,32.9)) library("ggplot2") library("maps") library("mapdata") library("geosphere") xlim = c(130,141) ylim = c(30,37) japan = map_data("japan") p<-ggplot() + borders("japan",fill="lightgray", size = 0.3) + theme_bw() + coord_map(xlim=xlim,ylim=ylim) + labs(y="",x="") p <-p +geom_polygon(data = tokai,aes(x = longitude, y = latitude),fill="green",alpha = 0.3) p <-p +geom_polygon(data = tonankai,aes(x = longitude, y = latitude),fill="red",alpha = 0.3) p <-p +geom_polygon(data = nankai,aes(x = longitude, y = latitude),fill="blue",alpha = 0.3) p <-p +geom_polygon(data = kasp,aes(x = longitude, y = latitude),fill="yellow",alpha = 0.3) p <-p +geom_polygon(data = tasp,aes(x = longitude, y = latitude),fill="darkgreen",alpha = 0.3) p <-p +geom_line(data = trench,aes(x = longitude, y = latitude),colour="gray30",linetype="dashed") p<-p + geom_text(data = trough,aes(x = longitude, y = latitude,label =names)) arrow1<-destPointRhumb(c(140.8,33.5),90-131, 63750/3*2) arrow2<-destPointRhumb(c(137,31.1),90-145, 105000/3*2) p<-p+ geom_path(aes(x=c(140.8,arrow1[1]),y=c(33.5,arrow1[2])),arrow=arrow(angle = 20,type = "closed"),size=1) + geom_path(aes(x=c(137,arrow2[1]),y=c(31.1,arrow2[2])),arrow=arrow(angle = 20,type = "closed"),size=1) p<-p + geom_point(data=eq, aes(x=longitude, y=latitude,fill=depth_rank,size=mag),alpha=0.8,shape=21,color="gray20")+ scale_fill_manual(values=c("red","orange","gold4","green","blue","purple"), breaks = c(" 10km 未満"," 10km以上20km未満"," 20km以上40km未満"," 40km以上80km未満"," 80km以上150km未満","150km以上"))+ labs(size="Magnitude",fill="Depth",title="震源分布(マグニチュード6以上)1923 ~ 2016/10/31[データ:気象庁]") + guides(size = guide_legend(order = 1), fill = guide_legend(order = 2)) + theme(text=element_text(size=12, family="TakaoExMincho")) p
|