Creating multi column legend in ggplot

前端 未结 1 1995
广开言路
广开言路 2020-12-01 06:17

I have the following script, which suppose to create a plot with two column legend.

 #!/usr/bin/Rscript
library(ggplot2)
library(plyr)
library(reshape2)
libr         


        
相关标签:
1条回答
  • 2020-12-01 06:41

    you must assign the guide to the correct aesthetic and you used fill:

    guides(fill=guide_legend(ncol=2))
    

    And you should take care of the warning with geom_bar

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