在R中,是否可以使用颜色轮廓框中的值来创建热图?

时间:2020-04-12 15:53:54

标签: r heatmap

monthly returns of the stock

       library(ggplot2)
       ggplot(mon_yr, aes(Year, Month,fill=N)) + geom_tile(aes(fill = N),colour = 
       "Black", na.rm = TRUE) + 
       scale_fill_gradientn(colours = c("red", "lightgreen", "green"),guide = 
       "Return") +
       guides(fill=guide_legend(title="Return")) +
       labs(title = "Monthly Trend of LT", x = "Year", y = "Month") +
       theme_bw() + theme_minimal()+
       theme(panel.grid.major = element_blank(), panel.grid.minor = 
       element_blank())

此代码片段跟踪股票的月收益,它在框中显示轮廓而不是实际值。

0 个答案:

没有答案