Reduce size of legend area in barplot

前端 未结 1 1819
心在旅途
心在旅途 2020-12-24 13:48

I can\'t reduce the size of the legend in this plot. Could someone help me out? I want it to appear topright, but with no more than 20% of the height of plot area

         


        
相关标签:
1条回答
  • 2020-12-24 13:56

    The cex parameter will do that for you.

    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)
    

    The plot

    0 讨论(0)
提交回复
热议问题