p <- ggplot(mpg, aes(displ, hwy)) p + geom_point() 图3 3. 在图中映射更多属性,以展示更多信息或美化图片 (1)颜色(color or colour) ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy, color = class)) 以“class”这个变量(汽车的分类,可以通过?mpg具体了解)映射到散...
p+geom_point(colour="red",size=3)qplot(wt,mpg,data=mtcars,colour=I("red"),size=I(3))# Varying alpha is usefulforlarge datasets d<-ggplot(diamonds,aes(carat,price))d+geom_point(alpha=1/10)d+geom_point(alpha=1/20)d+geom_point(alpha=1/100)# You can create interesting shapes by ...
1. GATK GenotypeConcordance p<-ggplot(data=data1,mapping=aes(x = TRUTH_SAMPLE,y=NON_REF_GENOTYPE_CONCORDANCE,colour=VARIANT_TYPE,shape=VARIANT_TYPE ))+geom_point(size=2)+scale_color_brewer(palette = 'Accent')+labs(x="Samples",y="Concordance",title="Zbolt_15X vs Downloded_30X")+theme(...
带条件的geom_point中的颜色赋值 我的代码如下: 代码语言:javascript 复制 ggplot(data=afirmaciones[afirmaciones$prueba==x,],aes(x=1,y=Afirmacion_d))+geom_point(size=20,stroke=5,aes(color=porcentaje),show.legend=F)+facet_wrap(~agregacion)+geom_text(aes(label=porcentaje),color="white",size=8...
利用两个geom_point()函数画叠加图,不过要注意先后顺序,前面的通常会被覆盖,所有需要在大小颜色等属性上设置不同,避免被全部覆盖 1 p+geom_point(colour="red", size = 5)+geom_point(aes(alpha=pce,size=uempmed)) 相对而言,geom_point()基本用法也相对比较简单,当然可以结合其他参数做出更好的图形。
point(aes(colour = qsec)) p + geom_point(aes(alpha = qsec)) p + geom_point(aes(colour =...
ggplot(df, aes(x, y)) + geom_point() + geom_line() 设置线条类型 economics_long %>%subset(variable %in% c("uempmed", "unemploy")) %>% ggplot(aes(date, value01, colour = variable)) + geom_line(aes(linetype = factor(variable))) + ...
geom_point(aes(color = cyl)) + geom_rug(aes(color = cyl)) + geom_smooth(aes(color = cyl), method = lm, se = FALSE, fullrange = TRUE) + scale_y_continuous(expand = c(0.1, 0.1)) + theme_bw() + theme(panel.background = element_rect(fill = "#F3F2EE", colour = "#F3F2...
(data=centers,aes(x,y,label=Cluster))p#将同一组的散点圈起来ggplot(data=intestine.plot.meta.dat)+geom_point(aes(x=tSNE_1,y=tSNE_2,colour=Clusters),size=0.5)+scale_colour_manual(values=mycolors[1:54])+stat_ellipse(aes(x=tSNE_1,y=tSNE_2,fill=Clusters),geom="path",level=0.95,alpha...
ggplot(A,aes(x=rank,y=avg_log2FC))+geom_point(size=3,color='#DC050C')+theme_bw()+theme(panel.grid.major=element_blank(),panel.grid.minor=element_blank(),axis.title=element_text(colour='black',size=15),axis.text=element_text(colour='black',size=12))+labs(x='Rank',y='Log2FC...