我在R中有一个像这样的数据框:
lat lon pressure
70.93 -8.67 991.1
70.93 -8.67 990.1
78.92 11.93 989.7
74.52 19.02 984.3
74.52 19.02 984.8
67.25 14.4 982.3
67.25 14.4 984.4
63.7 9.6 986.6
63.7 9.6 986.5
56.5 3.2 996.3
56.5 3.2 994.6
58.87 5.67 992.2
58.87 5.67 991.8
65.54 22.11 988.0
65.54 22.11 982.0
62.53 17.44 991.2
我正在尝试在地图上绘制轮廓线(等压线):
library(ggplot2)
# Here you can find the full data:
# https://www.dropbox.com/s/zuzeo17uggam99n/pressure_data.rds?dl=0
data <- readRDS("pressure_data.rds")
col <- c("#0000FF", "#00FFFF", "#00FF00", "#FFFF00", "#FFA500", "#FF0000")
mapWorld <- borders("world", colour="gray50", fill="gray50")
mp <- ggplot() + mapWorld
mp <- mp + geom_density2d(data = data, aes(x = lon, y = lat)) +
stat_density2d(data = data, aes(x = lon, y = lat, fill = ..level.., alpha = ..level..),
size = 0.01, bins = 16, geom = 'polygon') +
scale_fill_gradientn(colours=col) + scale_alpha(range = c(0.2, 1))
mp
我得到了这个。
为什么传奇看起来像1.0е-04,7.5е-05等?压力范围为583.5至1031.3。
如何获得正确的轮廓,像这样?
任何建议都将受到赞赏。