geom_vline(xintercept = c(-1.2,1.2), linetype = "dashed", color = "black")+ geom_point(aes(size = -log10(adj.P.Val), color = -log10(adj.P.Val)))+ scale_color_gradientn(values = seq(0,1,0.2), colors = c("#39489f","#39bbec","#f9ed36","#f38466","#b81f25"))+ ...
scale_fill_nbalogo_c<-function(name,direction=1){ if (!requireNamespace("ggplot2", quietly = TRUE)) { stop('ggplot2 is required for this functionality', call. = FALSE) } ggplot2::scale_fill_gradientn( colours = nbalogo_palette(name = name, direction = direction, n = 256, type =...
mid = "white", high = "blue") #使用R预设调色板 p + scale_color_gradientn(colours =rainbow(...
5.2我们为图像配色 scale_colour_gradientn(colours=c("darkblue","blue","#0092FF","#00FF92","#49FF00","#FFDB00","#FF0000","red","darkred"))+ 得到下面的图像: 5.3为图像加上线性回归和对角线 geom_smooth(method = "lm",formula = y~x,color="black")+ geom_abline(slope = 200,inter...
colour_gradientn中使用。因此,只需选择生成颜色的方式与我在上一篇文章中给出的答案相同,并在scale_...
scale_color_gradientn创建n色渐变 双色渐变 aaa=mpgaaa$cty<- aaa$cty-20f <- ggplot(aaa, aes(cty, hwy))+ geom_point(aes(color=cty))f + scale_colour_gradient(low = "green", high = "red")低-中-高三色渐变 f + scale_color_gradient2(low = "green", mid = "black", high n色渐变...
ggplot2::scale_colour_gradientn( colours = nbalogo_palette(name = name,direction = direction, n = 256, type = "continuous"),... ) } scale_color_nbalogo_c <- scale_colour_nbalogo_c scale_fill_nbalogo_d <- function(name, direction = 1, ...) { ...
ggplot(mpg, aes(displ, hwy, color = hwy)) geom_point() scale_color_gradient(low = '#132B43', high = '#56B1F7',guide='colourbar') 一幅从'#132B43'到'#56B1F7'的渐变点图 2、调用调色板颜色 scale_colour_brewer( ..., type = 'seq', palette = 1, direction = 1, aesthetics = ...
1.条的颜色Map到fill美学,而不是color(条的轮廓)。因此scale_fill_gradientn()是合适的。1.填充...
color = "black", size = 3.5) + xlab(sprintf("PC1 (%.1f%%)", PC1_varEx)) + ylab(sprintf("PC2 (%.1f%%)", PC2_varEx)) + scale_colour_gradientn(colours = rev(pal), breaks = seq(from = 5, to = 25, by = 5)) +