图中子图中间列图的大小

时间:2018-04-08 16:16:22

标签: r plotly subplot

我也在情节论坛上看过这个问题/问题,但没有找到答案,所以我在这里发帖。

有没有人知道如何让中间地块与其他地块相同? 当制作3 x 3面板的情节时,它也发生在中间行

中间的绘图列最终比外部列更窄:

library(plotly)
library(purrr)


# using lapply
mtcars %>% 
  split(mtcars$cyl) %>% 
  lapply(function(x) {
    plot_ly(data = x, 
            x = rownames(x), 
            y = ~mpg, 
            type = "bar")
  }) %>% 
  subplot(margin = .05)

1 个答案:

答案 0 :(得分:1)

不是您问题的真正解决方案,但我们可以通过在<span id="target"> 'Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!" He took his vorpal sword in hand: Long time the manxome foe he sought -- So rested he by the Tumtum tree, And stood awhile in thought. And, as in uffish thought he stood, The Jabberwock, with eyes of flame, Came whiffling through the tulgey wood, And burbled as it came! One, two! One, two! And through and through The vorpal blade went snicker-snack! He left it dead, and with its head He went galumphing back. "And, has thou slain the Jabberwock? Come to my arms, my beamish boy! O frabjous day! Callooh! Callay!' He chortled in his joy. 'Twas brillig, and the slithy toves Did gyre and gimble in the wabe; All mimsy were the borogoves, And the mome raths outgrabe. </span>

中设置widths来使中间图更大一些
subplot

enter image description here