【发布时间】:2021-07-02 05:03:33
【问题描述】:
我正在使用此代码:
library(tidyverse)
library(reshape)
mtcars <- melt(mtcars, id="vs")
mtcars$vs <- as.character(mtcars$vs)
ggplot(mtcars, aes(x=vs, y=variable, fill=value)) +
geom_tile()
如何将平均值作为文本粘贴到每个图块上?我试过 + geom_text(mtcars, aes(vs, variable, label=mean)),但不起作用。
另外,我怎样才能颠倒x轴上0和1的顺序?
【问题讨论】:
标签: r ggplot2 tidyverse geom-text geom-tile