自定义 Piechart 圆环的小数点

Customise decimal point for Piechart donut

提问人:QVN 提问时间:11/2/2023 最后编辑:Philipp HanckeQVN 更新时间:11/2/2023 访问量:18

问:

这是我的第一个 PiecDonut 图表,标签上的百分比看起来太乱了。我希望它是小数点后 1 或 2 位,即牛肉 (78.97%)。有什么建议吗?提前致谢。

GHG emissions by gas type

这是我的代码和数据

dat <- read_excel('dat.donut.xlsx' , "GHG", range = "A1:I4") %>% 
gather("System", "GHG", -c(Type)) %>% 
  filter(!GHG=="0")

p <- PieDonut(dat, aes(Type, System, count=GHG), title = "GHG Emissions Profile by Gas Type",
              #start=3*pi/2,
              labelpositionThreshold=0.1,
               ratioByGroup = FALSE, 
               explode = 1,
              explodePie = TRUE,
              explodeDonut = FALSE,
              maxx=1.7,
              donutLabelSize = 4,
              pieLabelSize = 5,
              titlesize = 8,
              labelposition = getOption("PieDonut.labelposition", 1),
              family = getOption("PieDonut.family", ""),
              showRatioThreshold = getOption("PieDonut.showRatioThreshold", 0.02),
              explodePos = 0.1)
标签 舍入 饼图

评论


答: 暂无答案