所以我使用以下方法生成p值的热图:
library(ggplot2)
p <- ggplot(res, aes(x=group, y=variable)) +
geom_tile(aes(fill = value), colour = "yellow") +
scale_fill_gradient(low = "yellow", high = "red", name="p-value") +
ggtitle("title") +
theme(axis.text.x=element_text(angle=90)) +
labs(x="maoa",y="maob")
print(p)
并想使用
d + scale_colour_gradient2(low = "red", mid = "black", high = "green", midpoint = 0.05, guide = "legend")
添加中音颜色并调整中点。但是,这输出结果没有我输入的颜色和中点。有什么建议吗?