I can't figure out why the bottom corners background is white, while the rest of the plot is grey. Is there anyway I can change the bottom corners color to the same background as the rest of the plot?
The code im using for each plot is:
HP_specifikationer_model1 <- ggplot(Svar_spec_data)+geom_hline(yintercept=0)
geom_line(aes(y=HP1, x=kvartaler, color = "HP-BNP-KRE-REN")) +
geom_line(aes(y=HP2, x=kvartaler, color = "REN-KRE-HP-BNP")) +
geom_line(aes(y=HP3, x=kvartaler, color = "BNP-KRE-REN-HP")) +
geom_line(aes(y=HP4, x=kvartaler, color = "KRE-HP-REN-BNP")) +
geom_line(aes(y=HP5, x=kvartaler, color = "BNP-KRE-HP-REN")) +
geom_line(aes(y=HP6, x=kvartaler, color = "BNP-REN-HP-KRE")) +
geom_line(aes(y=HP7, x=kvartaler, color = "REN-HP-BNP-KRE")) +
scale_color_manual(name='Specifikation',
breaks=c('HP-BNP-KRE-REN', 'REN-KRE-HP-BNP', 'BNP-KRE-REN-HP',
'KRE-HP-REN-BNP', 'BNP-KRE-HP-REN', 'BNP-REN-HP-KRE',
'REN-HP-BNP-KRE'),
values=c('HP-BNP-KRE-REN'='red', 'REN-KRE-HP-BNP'='blue', 'BNP-KRE-REN-HP'='green',
'KRE-HP-REN-BNP'='cyan', 'BNP-KRE-HP-REN'='lightpink', 'BNP-REN-HP-KRE'='orange',
'REN-HP-BNP-KRE'='black'))+
labs(title = "Varrierende SVAR matricer ved stød til Boligpriserne", x="Lag (Måneder)", y="Respons fra boligprisen", caption = "Egne beregninger", color= T)+
theme(legend.position="right") + theme(panel.grid.minor.x = element_blank()) + th
The th at the end of the code is defined with this code:
th <- theme(title = element_text(colour = "#404040"),
plot.background=element_rect(fill="#f3f3f3"),
panel.background = element_rect(fill="#f3f3f3"),
legend.background = element_rect(fill="#f3f3f3"),
plot.subtitle = element_text(color="#666666"),
plot.caption = element_text(color="#616161", size=9),
legend.key = element_rect(fill = "#f3f3f3", colour = "#f3f3f3"),
plot.margin = unit(c(0.5, 0.7, 0.5, 0.7), "cm"),
panel.border = element_rect(color = "black",
fill = NA,
size = 0.15))
The code im using is to arrange my plots is:
ggarrange(BNP_specifikationer_model1,
RENTE_specifikationer_model1,
KREDIT_specifikationer_model1,
HP_specifikationer_model1,
ncol=2, nrow=2, common.legend = TRUE, legend="bottom")