gpt4 book ai didi

r - 如何调整标题空间并在 r 中绘图

转载 作者:行者123 更新时间:2023-12-05 01:36:49 24 4
gpt4 key购买 nike

gpX83= plot_ly(df_X83, 
labels = ~Var1,
values=~Freq,
type ='pie', sort = F) %>% layout(title = list(text = paste0('Gráfico 83.1','<br>', '<sup>',
'Com que frequência você participou de novas capacitações?','</sup>'),x = 0.1),
colorway = c('#E41A1C', '#377EB8' , '#4DAF4A', '#984EA3','#FF7F00', '#FFFF33', '#A65628', '#F781BF'),
legend= list(orientation='h'))

enter image description here

我需要在图表的标题和区域之间留一个空格,有人知道该用什么函数吗?

最佳答案

margin 需要一个变通办法。它可以作为 margin = 添加到布局中。

例如:

mrg <- list(l = 50, r = 50,
b = 50, t = 50,
pad = 20)

gpX83 <- plot_ly(df, labels = ~Project, values=~Emissions,
type ='pie', sort = F) %>%
layout(title = list(text = paste0('Gráfico 83.1','<br>', '<sup>',
'Com que frequência você participou de novas capacitações?','</sup>'),x = 0.1),
colorway = c('#E41A1C', '#377EB8' , '#4DAF4A', '#984EA3','#FF7F00', '#FFFF33', '#A65628', '#F781BF'),
legend= list(orientation='h'),
margin = mrg)

关于r - 如何调整标题空间并在 r 中绘图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61689721/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com