- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个包含四类元音的数据集,类似于以下内容:
speaker vowel_category f1 f2
1 a x x
1 b x x
1 c x x
1 d x x
2 a x x
2 b x x...
此 geom_point 代码使用 stat_ellipse 将它们全部绘制成一张图,并且是我需要的 90%:
ggplot(data = topicsubset_ikf, aes(x = F2, y = F1, shape = CATEGORY)) +
geom_point() +
scale_y_reverse() +
scale_x_reverse() +
xlab("F2") +
ylab("F1") +
labs(title = "All speakers with KIT and FLEECE tokens") +
coord_cartesian(xlim = c(1.9, 1.1), ylim = c(0.3, 1.5)) +
facet_wrap(~ SPEAKER) +
scale_color_manual(values = c("#000000", "#FF8F00", "#000000", "#A200FF")) +
stat_ellipse(geom = "polygon", alpha = 1 / 2, aes(fill = CATEGORY))
但是,如果我可以只围绕四个类别中的两个(例如 a 和 b)而不是所有 4 个绘制椭圆,那将是理想的,这样我就可以查看 c 和 d 相对于 a 和 b 的分布.到目前为止,我还没有找到一种方法——我曾尝试将多个数据集组合在一个图表上,但无济于事。有什么建议吗?
最佳答案
我有同样的问题,我发现现在你可以像这样在 stat_ellipse 中指定组:
stat_ellipse(geom = "多边形", alpha = 1/2, aes(fill = CATEGORY, group = CATEGORY))
关于将 stat_ellipse 限制为某些数据点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46908396/
我有一个包含四类元音的数据集,类似于以下内容: speaker vowel_category f1 f2 1 a x x 1
您有一个包含多个组(例如 10 个)的散点图。您为各组绘制 95% 置信度椭圆。 问题:你不需要看到所有组的置信度椭圆(因为没有必要或者因为其中一些点很少,导致巨大的椭圆) 问题:如何去除确定组的置信
我想创建一个具有 95%“精确”置信椭圆的二元正态分布散点图。 library(mvtnorm) library(ggplot2) set.seed(1) n <- 1e3 c95 <- qchisq
因此,我正在尝试更改从 ggplot2 中的 stat_ellipse 生成的椭圆的线型(参见此处 https://raw.github.com/low-decarie/FAAV/master/r/s
Similar to this question 当type = "norm"时,有什么方法可以计算这个椭圆的面积吗? 默认为 type = "t"。 type = "norm" 显示不同的椭圆,因为
这可能很简单,但我试图在我的 PCoA 图上围绕我的治疗绘制椭圆。 我的数据框 (sc) 是: MDS1 MDS2 Treatment X1xF1 -0.197
我是一名优秀的程序员,十分优秀!