0
のように私の入力データが見えます:私は「PROGRESSのいくつかのテキスト(値を追加するヒートマップを生成Rのggplot2:ヒートマップの両側に伝説と値カウントにカスタムテキストを追加すること
COMPANY DOMAIN REVIEW PROGRESS
Company A Service Good +
Company A Response Good +
Company A Delay Very Good
Company A Cost Poor -
Company B Service Poor -
Company B Delay Average
Company B Cost Good +
Company C Service Very Poor +
Company C Cost Average
は私のコードです:
require("ggplot2")
graph <- read.table("input.tab", header=T, sep="\t")
ggplot(data=graph, aes(x=COMPANY, y=DOMAIN, group=REVIEW, fill=REVIEW)) +
geom_tile() +
geom_text(aes(x=COMPANY, y=DOMAIN, label=PROGRESS)) +
scale_x_discrete(expand = c(0, 0)) +
scale_y_discrete(expand = c(0, 0)) +
geom_vline(xintercept=seq(1.5, length(graph$COMPANY)+0.5)) +
geom_hline(yintercept=seq(1.5, length(graph$DOMAIN)+0.5)) +
theme(
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
panel.background = element_blank(),
plot.background = element_blank(),
axis.title=element_blank(),
axis.text.x = element_text(angle=45, size=12, hjust=1)
)
私は(図は手動で以下の変更を参照)を追加することに苦労していますしかし:すでに
(1)以下の「PROGRESS」の伝説カラーコードの一部として、記載されている:
+ Better
- Worse
(2)プロットの右側と凡例の間の各列上で利用可能なデータの数
プロット
の上に各列の利用可能なデータの(3)のカウント任意のアドバイスはありますか?