小编Ros*_*nna的帖子

R plot在ggpplot2中输出filled.contour()输出

我想用fill.contour()创建这个图,但是在ggplot2中,我该怎么做?

我想使用ggplot2,因为图形约定更容易.我想使用filled.contour()的原因是因为我尝试了geom_tile()和image.plot()并且它们都创建了类似于输出的平铺,我需要一个类似于filled.contour()的输出.

这是我的数字:

在此输入图像描述

码:

library(akima)

df <-read.table("Petra_phytoplankton+POM_xydata_minusNAs_noduplicates.txt",header=T)
attach(df)
names(df)
fld <- with(df, interp(x = longitude, y = latitude, z = d13C))

filled.contour.ungeoreferenced <- 
  (filled.contour(x = fld$x,
                  y = fld$y,
                  z = fld$z,
                  color.palette =
                    colorRampPalette(c("blue", "green", "yellow",
                                       "orange", "red")),
                  xlab = "Longitude",
                  ylab = "Latitude",
                  key.title = title(main = "d13C", 
                                    cex.main = 1)))
Run Code Online (Sandbox Code Playgroud)

数据片段:

latitude    longitude   d13C
-65 -70 -27.7
-61 150 -32.2
-61 150 -28.3
-60 116 -26.8
-60 116 -24.7
-47 38  -24.8
-38 150 -20.5
19  -65.7 …
Run Code Online (Sandbox Code Playgroud)

graphing r contour ggplot2

7
推荐指数
2
解决办法
1万
查看次数

标签 统计

contour ×1

ggplot2 ×1

graphing ×1

r ×1