减少R matplot中的图例大小

时间:2018-07-19 02:17:21

标签: r matplotlib

我试图使用R中的以下代码创建图表:

myplot<-function(data,rows,Colm){
  Data<-data[rows,Colm,drop=F]
  matplot(t(Data), type = "b", pch=15:18, col = c(1:4, 6))
  legend("bottomleft",inset = 0.01, legend = Players[rows],col = c(1:4, 6), 
pch=15:18, horiz = F)
}
myplot(Games)

并得到以下图:enter image description here

有人可以帮我缩小图例的大小吗?

1 个答案:

答案 0 :(得分:0)

可以在这里找到答案:Reduce size of legend area in barplot

键是图例函数调用中的cex参数。

默认值等于1。大于默认大小大于1。根据您的问题,您可能希望将值设为.5,然后从那里开始进行实验,直到达到所需大小为止。

相关问题