Align two line legend title to the left with [removed])

后端 未结 1 1533
灰色年华
灰色年华 2021-01-11 22:11

Using this script

df <- data.frame(x = 1:5, y = 1:5, color = letters[1:5])
ggplot(df, aes(x, y, fill = color)) +
  geom_point(size = 4, pch = 21) + 
  gui         


        
相关标签:
1条回答
  • 2021-01-11 22:15

    quick and ugly answer but it does the job until someone post better...

    ggplot(df, aes(x, y, fill = color)) +
      geom_point(size = 4, pch = 21) + 
      guides(fill = guide_legend(
        title = expression(atop(Median~Nitrate-Nitrogen~(NO[3]^{textstyle("-")}-N), "Concentration"~(mg~L^{textstyle("-")})~phantom (1000000)~phantom (1000000)))))
    
    0 讨论(0)
提交回复
热议问题