绘制山脊图
https://blog.csdn.net/biocity/article/details/107570578
https://blog.csdn.net/weixin_43180762/article/details/109603279
https://zhuanlan.zhihu.com/p/371296688
https://zhuanlan.zhihu.com/p/339605450
所需要的包:
ggridges
ggplot()+geom_density_ridges(data=, aes(x=, y=, fill=), alpha=, from=)
- 1.
x=
: 横坐标对应列名- 2.
y=
: 纵坐标分割所用的量,这个量必须是因子- 3.
from=
: 左侧开始的数值,如果不设置,函数会自动进行模拟填补,出现不存在的值
qq <- kk_new[,c(19,17)]
head(qq) #'示例一
ggplot()+geom_density_ridges(data = qq, aes(x=Pseudotime, y=type, fill=type),alpha=0.8)+theme_cowplot() + scale_y_discrete(limits=as.factor(rev(c(1,2,3,6,5,0,4)))) #示例二
ggplot()+geom_density_ridges(data = qq, aes(x=Pseudotime, y=type, fill=type),alpha=0.8)+theme_ridges() + scale_y_discrete(limits=as.factor(rev(c(1,2,3,6,5,0,4)))) #使用山脊图主体,示例三
示例一
示例二
示例三