用R绘制平滑的梯度热图

时间:2019-07-26 19:44:16

标签: r ggplot2

我想以矩阵格式绘制热图。我必须生成完全像的情节 Example Plot 我尝试了ggplot2和facet_grid()函数来生成。但是结果中没有渐变阴影

ggplot(data = df, aes(x=values, y=celL, fill = values)) + 
  geom_tile() + 
facet_grid(~state, scales = "free", space = "free") + 
  scale_fill_gradient(low = "white", high = "red") + 
theme_bw()

我得到的结果是 My Plot

0 个答案:

没有答案