繁体   English   中英

在情节R中改变标题位置

[英]Change title position in plotly R

我为我正在使用的数据集创建了世界地图,但是,绘图的标题位于图表上方,两者之间有一个巨大的空间。

绘制图表


map_World <- list(
  scope = 'world',
  lakecolor = toRGB('white'))

Map4 <- plot_geo(regions) %>%
  add_trace(
    z = ~column1.x, locations = ~`ISO`,
    color = ~column1.x, colors = c("red", "blue", "green")
  ) %>%
  colorbar(title = "Legend",x = 1, y = 0.8) %>%
  layout(title = "Sub indices for the different dimensions",
         geo = map_World)

我希望标题正好在图表上方,但它不起作用。

我相信你可以调整图表标题属性:

https://github.com/plotly/plotly.js/pull/3276

尝试你的布局,如:

layout(title = list(text = "Sub indices for the different dimensions", y = 0.8),
         geo = map_World)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM