0
我想在圖例沒有標題時使圖例邊框更緊。實際上,圖例鍵上方有一個空白區域。我也想把邊框變成虛線。沒有標題的緊密圖例邊框
情節是基於以下代碼:
library(ggplot2)
ggplot(temp, aes(x=diff_abs, y=emp_est_15, color=diff_sign)) + geom_point(shape=1, size=2) +
scale_colour_manual(values=c("green4", "red")) +
scale_x_log10(breaks=10^(0:3)) + scale_y_log10(breaks=c(c(2,4,8) %o% 10^(0:3))) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
panel.background = element_blank(), axis.line = element_line(colour = "black"),
axis.text = element_text(color="black", size=13), axis.title = element_text(color="black", size=13),
legend.key = element_blank(), legend.position=c(.2,.8), legend.box.background = element_rect(),
legend.background = element_blank()) +
labs(x="\nGain ou perte d'emploi 2001-2015 (milliers, échelle log 10)",
y="Emploi 2015 (milliers, échelle log 10)\n", color="")
?'主題(legend.title = element_blank())來改變' –