如何在r中调整标题空间和剧情的位置

问题描述 投票:0回答:1
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

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

r layout plotly pie-chart
1个回答
0
投票

页边距需要一个变通的方法。它可以被添加到布局中,如 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) 
© www.soinside.com 2019 - 2024. All rights reserved.