我正在準備出版物的數字。我正在通過設置xlab("")
來省略x標籤,但是ggplot2會生成一個空格而不是完全刪除標籤。我如何擺脫空白(在下面的圖中用紅色矩形標記)?如何擺脫ggplot2情節中的空白?
的完整代碼:
ggplot(data, aes(x=Celltype, y=Mean, fill=factor(Dose), label=p.stars)) +
geom_bar(stat = "identity", position = position_dodge(width=0.9), aes(group=Dose)) +
geom_errorbar(aes(ymin = Mean - SEM, ymax = Mean + SEM), stat = "identity", position = position_dodge(width=0.9), width=0.25) +
geom_text(aes(y = Mean + SEM), size = 5, position = position_dodge(width=0.9), hjust = .5, vjust = -1) +
xlab("") +
ylab("Concentration") +
scale_fill_grey(name = "Dose") +
theme_bw()
試試'xlab(NULL)'' – hadley