R中刻面图的颜色条宽度
我有三个标记图像的示例数据集:R中刻面图的颜色条宽度,r,ggplot2,R,Ggplot2,我有三个标记图像的示例数据集: set.seed(2021) data_example <- lapply(c(1,2,3), function(i) { expand.grid(Row=1:4,Col=1:4) %>% mutate(label = i) }) data_example <- Reduce(rbind,data_example) data_example$value <- sample(0:255,48) 任何帮助都将不胜感激。如果
set.seed(2021)
data_example <- lapply(c(1,2,3), function(i) {
expand.grid(Row=1:4,Col=1:4) %>%
mutate(label = i)
})
data_example <- Reduce(rbind,data_example)
data_example$value <- sample(0:255,48)
任何帮助都将不胜感激。如果您将引导参数放入
缩放填充梯度
参数中,您将获得成功:
...+
scale_fill_gradient(low="white", high="blue", guide=guide_colorbar(barwidth=.5)) +
你能试试
fill=guide\u colorbar
而不是color=guide\u colorbar
?看起来您正在将美学中的填充
设置为值
。您好@Ben,效果很好,谢谢!,请问,你能把它作为一个答案,标记为“已回答”,并提供给其他人吗?
...+
scale_fill_gradient(low="white", high="blue", guide=guide_colorbar(barwidth=.5)) +