簡體   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