LoginSignup
1
3

More than 3 years have passed since last update.

Rで地図を描く【その6: 等深線図】

Posted at

0. 等深線図とは?

等深線図とは端的に言うと等高線図の海洋版で、水深の等しい場所を結んだ線のことです。

1. Rで等深線図を描く

下記のリンク先の論文 (Taniguchi et al., 2021) では、Rを用いて等深線の作図を行なっています。

具体的な手順は以下の通りです。(ここでは、60mと120mの等深線を描きます)

library(marmap)
library(ggplot2)
library(mapproj)
library(ggsn)
Japan <- getNOAA.bathy(lon1 =115,lon2 =147,lat1 =20,lat2 = 55, resolution = 1)

png(filename="plot.png")    
ggplot(Japan)  + xlim(125, 140) + ylim(29, 39) + 
  xlab("longitude") + ylab("latitude") +
  geom_contour(aes(x=x, y=y, z=z), colour = "green", breaks = -60) +
  geom_contour(aes(x=x, y=y, z=z), colour = "blue", breaks = -120) +
  geom_contour(aes(x=x, y=y, z=z, ltw = 2), colour = "brown", breaks = 0, size = 1) +
  scalebar(data = NULL, x.min = 125, x.max = 139, y.min = 29, y.max = 39,
           dist = 100, dist_unit = "km", transform = TRUE, model = "WGS84") +
  theme_bw() +
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
        panel.background = element_blank()) +
  coord_map()
dev.off()
1
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3