我无法在此图中减小图例的大小。有人可以帮帮我吗?我希望它看起来是正确的,但不超过绘图区高度的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)
答案 0 :(得分:35)
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)