我无法在此情节中缩小图例的大小。有人可以帮我吗?我希望它显示为右上角,但不超过绘图区域高度的20%

a <- c(3, 2, 2, 2, 1, 2 )
barplot(a, beside = T,
col = 1:6, space = c(0, 2))
legend("topright", legend = c("a", "b", "c", "d", "e", "f"), fill = 1:6, ncol = 2)

最佳答案

cex参数将为您完成此操作。

a <- c(3, 2, 2, 2, 1, 2 )
barplot(a, beside = T,
        col = 1:6, space = c(0, 2))
legend("topright",
       legend = c("a", "b", "c", "d", "e", "f"),
       fill = 1:6, ncol = 2,
       cex = 0.75)

关于r - 减少小节中图例区域的大小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24361598/

10-12 23:21