【发布时间】:2020-09-12 02:45:44
【问题描述】:
如何将图例向左和底部移动几个点(图形框线的宽度)?
任务:我想让图例的背景半透明,但不与图形框重叠。
(红色边框 - 更好地显示问题)
使用代码:
image + theme(
panel.background = element_rect(fill = "white", color = NA),
panel.border = element_rect(fill = NA, color = "black", size = 2),
panel.grid.major = element_line(color = "#00000040", linetype = 3),
axis.text = element_text(size = 10),
axis.title = element_text(size = 12),
axis.title.x = element_text(margin = margin(t = 10)),
axis.title.y = element_text(margin = margin(r = 10)),
legend.key = element_rect(fill = NA, color = NA),
legend.background = element_rect(fill = "#ffffff80", color = "red", size = 1),
legend.justification = c(1, 1),
legend.position = c(1, 1),
legend.title = element_text(size = 10, color = "black"),
plot.title = element_text(hjust = 0.5),
)
【问题讨论】:
标签: r ggplot2 themes legend legend-properties