以下是我的数据框
df
a b c d
1 0 0 0 0
2 0 0 0 1
3 0 0 0 0
4 0 1 0 0
这是生成热图的代码 . 它使用R中的库高级图 .
hchart(as.matrix(df), "heatmap", hcaes(x = variable, y = name, value = value)) %>% hc_colorAxis(stops = color_stops(2, c("yellow","blue")))%>%hc_size(height = 500)
我的问题是,如何更改热图中显示的值/数字的颜色 . 或者,如何从热图中删除值?
1 回答
您可以将代码更改为以下代码:
加载您的数据:
然后,生成热图并更改颜色modifyng
color_stops
参数:结果如下: