Change title position in plotly R

Viewed 9337

I created the world map for the dataset I am working with however, the title of the plot is way above the chart and there is a huge space in between.

plotted chart


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)

I expect the title to be right above the chart but it is not working.

1 Answers

I believe you can adjust the chart title attributes:

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

Try for your layout something like:

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