【问题标题】:Is there an R function to use waffle charts with two glyphs? One to the left and one to the right?是否有 R 函数可以使用带有两个字形的华夫饼图?一个在左边,一个在右边?
【发布时间】:2020-05-27 10:18:43
【问题描述】:

我想“合并”这两个华夫饼图:

waffle(pct, rows = 5, use_glyph = "angle-left", glyph_size = 9, 
   colors = c("grey", adjustcolor("green", alpha.f = 0.0)),
   title = "Motoraccidents in bends",
   xlab = "1 bike = 1% of all motorcycle accidents",
   legend_pos = "bottom") 
waffle(pct, rows = 5, use_glyph = "angle-right", glyph_size = 9, 
   #colors = c("White", "darkred"),
   colors = c(adjustcolor("green", alpha.f = 0.0), "darkred"),
   title = "Motoraccidents in bends",
   xlab = "1 bike = 1% of all motorcycle accidents",
   legend_pos = "bottom") 

有什么想法吗?

【问题讨论】:

    标签: r waffle-chart


    【解决方案1】:

    由于我在文档和互联网上都找不到任何内容,因此我尝试了四处 - 并找到了答案:只需为 use-glyph 函数制作一个矢量。

    waffle(pct, rows = 5, use_glyph = c("arrow-left", "arrow-right"), glyph_size = 9, 
       colors = c("red", "darkred"),
       title = "Motoraccidents in bends",
       xlab = "1 glyph = 1% of motorcycle accidents in bends",
       legend_pos = "bottom") 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多