相关疑难解决方法(0)

用ggplot2画一个圆圈

也许这是一个愚蠢的问题,但我找不到ggplot2手册中的答案,也没有找到"阿姨"谷歌......

如果我有一个中点和一个直径,如何用ggplot2绘制一个圆作为附加图层?谢谢你的帮助.

geometry r ggplot2

55
推荐指数
6
解决办法
3万
查看次数

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万
查看次数

标签 统计

ggplot2 ×2

r ×2

contour ×1

geometry ×1

graphing ×1