我想在多面 ggplot 中绘制每个面板的 p 值。如果 p 值大于 0.05,我想按原样显示 p 值。如果p值小于0.05,我想以科学计数法显示该值(即0.0032 -> 3.20e-3;0.0000425 -> 4.25e-5)。
我为此编写的代码是:
p1 <- ggplot(data = CD3, aes(location, value, color = factor(location),
fill = factor(location))) +
theme_bw(base_rect_size = 1) +
geom_boxplot(alpha = 0.3, size = 1.5, show.legend = FALSE) +
geom_jitter(width = 0.2, size = 2, show.legend = FALSE) +
scale_color_manual(values=c("#4cdee6", "#e47267", "#13ec87")) +
scale_fill_manual(values=c("#4cdee6", "#e47267", "#13ec87")) +
ylab(expression(paste("Density of clusters, ", mm^{-2}))) +
xlab(NULL) +
stat_compare_means(comparisons = list(c("CT", 'N'), c("IF","N")),
aes(label = ifelse(..p.format.. < 0.05, formatC(..p.format.., …Run Code Online (Sandbox Code Playgroud) 我有一个由 1,000 个点组成的多边形。是否可以计算每个点的曲率?该多边形最初仅包含 13 个点:
43748.72 40714.19
43743.99 40716.16
43741.36 40720.19
43740.95 40726.46
43742.67 40729.28
43745.52 40730.97
43748.72 40731.14
43752.86 40729.43
43756.77 40723.24
43757.19 40719.73
43755.27 40716.68
43752.23 40714.76
43748.72 40714.19
Run Code Online (Sandbox Code Playgroud)
然后我使用 smoothr 包中的 smooth 函数进行插值,现在多边形有 1,000 个点,如下所示:
现在我想计算每个点的曲率。但既然这是一个封闭的对象,那么如何实际执行计算呢?
编辑
我终于找到了一个带有突起的电池来测试稳健性。该单元格看起来像:

事实上,该图捕获了两个突起,但曲率值能那么高吗?我读了一篇论文,似乎它们的值都在 1 以内:
论文链接:https://www.biorxiv.org/content/10.1101/623793v1.full