scale_color_discrete或scale_color_hue设置颜色不是很直观,如果想要啥来啥,那就用manual类型函数: 1. p + geom_point() + scale_color_manual(values = c("blue", "cyan", "yellow", "orange", "red")) 2. p + geom_point() + scale_color_manual(values = rainbow(5)) 1. 2. grey灰度标尺...
ggplot(data=mtcars, aes(x=mpg, y=disp, color=qsec)) + geom_point() + scale_colour_gradient(low="lightgreen", high="darkgreen") 以上是三种常见的配色方案。 当然,也有其它的可以选择,比如:scale_fill_discrete 可以指定离散型配色;scale_colour_viridis_d() 和 scale_colour_viridis_c() 分别指定...
做OS pheatmap 中报错:Continuous value supplied to discrete scale 解决方式 1. 是查看code color 是否不对应ggplot(data = dat, aes( X, PFS, colour=CensorPFS)) + geom_point(alpha=0.5, size=1.75) + theme_bw()+ scale_colour_manual(values=c( "dodgerblue","darkgrey","firebrick2"))描述了三...
geom_hline(aes(yintercept = 0),alpha = 0.5,size = 1)+ scale_y_continuous(name = NULL, limits = c(-1,1),labels = scales::percent)+scale_x_discrete(name = NULL, limits = c("Q4","Q3","Q2","Q1"),labels= c("Product 4","Product 3","Product 2","Product 1"))+ coord_fli...