Heatmap with continuous rainbow colours

前端 未结 3 1989
执笔经年
执笔经年 2021-01-21 13:04

First of all I have to say that I read many threads about heatmap and ggplot2 here in stackoverflow and elsewhere. But my problem isn\'t solved yet.

I have got the foll

3条回答
  •  天涯浪人
    2021-01-21 14:01

    ggheatmap <- ggplot(data = dat.plot, aes(x=Var1, y=Var2, fill=value)) + 
      geom_raster(interpolate=TRUE)+
      scale_fill_gradientn(colors=rev(c("darkred", "red", "orange", "yellow",    "green", "lightgreen", "lightblue", "darkblue")))+
      theme(axis.text.x = element_text(angle = 0))+ 
      coord_fixed()
    print(ggheatmap)
    

    Now it looks blurred. But o.k. If you think it can't be done better, I let it as it is. Thank you very much!

提交回复
热议问题