调色板 颜色配色ggplot colorRampPalette(c(“royalblue“,“firebrick3“))(2) viridis包 配色

ggplot(vis.data, aes(x=col, y=row, fill= Pgk1)) + geom_point() + theme_void()+
  scale_fill_gradientn(colors = colorRampPalette(c("blue","white","green"))(12))#colorRampPalette(c("royalblue","firebrick3"))(2)



ggplot(vis.data, aes(x=col, y=row, color = Bnip3l)) + geom_point() + theme_void()+
   # scale_discrete_manual()
  scale_fill_gradient(
    low = "blue",
    high = "red",
    space = "Lab",
    na.value = "grey50",
    guide = "colourbar",
    aesthetics = "color"  #fill
  )

ggplot(vis.data, aes(x=col, y=row, color = Bnip3l)) + geom_point() + theme_void()+
  # scale_discrete_manual()  
 # scale_color_manual(  colorRampPalette(c("blue","white","green"))(12)  #针对分类变量
  scale_color_continuous(
    low = "blue",
    high = "green"
  )


  

调色板 颜色配色ggplot colorRampPalette(c(“royalblue“,“firebrick3“))(2) viridis包 配色_第1张图片

viridis包  配色

library(viridis)


DefaultAssay(pbmc) <- 'progeny' 
p1= FeaturePlot(pbmc,features = "NFkB", coord.fixed = T, order = T, cols = viridis(10)) 
p2=FeaturePlot(pbmc,features = "MAPK", coord.fixed = T, order = T, cols = viridis::turbo(10)) 

 调色板 颜色配色ggplot colorRampPalette(c(“royalblue“,“firebrick3“))(2) viridis包 配色_第2张图片

你可能感兴趣的:(java,服务器,前端)