带有stat_qq的Q-Q图-如何在保持原始未分组样本分布的同时按组进行颜色编码

时间:2019-04-05 20:32:57

标签: r ggplot2

对于一系列多面分位数图,试图通过分组变量对各个点进行颜色编码(或按形状区分),而无需使分组继续沿x轴定位。一个使用mtcars数据集的简单示例:

library(tidyverse)

# the shape of the distribution I'm seeking
ggplot(mtcars, aes(sample = mpg)) + stat_qq()

# desired color-coding, but applied to original ungrouped sample
ggplot(mtcars, aes(sample = mpg, colour = factor(cyl))) + stat_qq()

犹豫不决,因为我肯定显然缺少明显的东西……但是搜索并没有给出答案,我很沮丧。

0 个答案:

没有答案