Subplot panel height not consistent
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- r
調査の方向性
まず、提供されている generate_subplot の例を 2、4、8 行で実行し、レンダリングされた図のパネルと x 軸の高さを比較します。subplot() が繰り返された plot_ly オブジェクトとその高さの値をどのように結合するかを追跡します。各パネルが要求された一貫した高さを持ち、図全体の高さが期待どおりにスケールすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
There doesn't seem to be a way to set the total figure size for subplot().
Individual panel height can be specified in the call to plot_ly and (as i understand it) that height is scaled with the number of panels to become the total figure size.
I tried using this by passing to each subplot the individual plotheight multiplied with the number of subplots (nrows) so the total height of the total figure would be plotheight * nrows.
It turns out the heights aren't strictly adhered too.
Comparing the total height of the first two panels you can clearly see the x axes are at different heights:

generate_subplot <- function(nrows, margin = NULL){
if(is.null(margin)) margin = c(0,0,0,0)
p <- plotly::plot_ly(mtcars,
x = ~cyl, y = ~mpg,
color = ~rownames(.data),
type = "bar",
height = 150 * nrows
) %>% plotly::layout(
showlegend = FALSE,
shapes = list(
list(
type = 'rect',
fillcolor = "gray",
line = list(color = "gray"),
opacity = 0.05,
x0 = 0, x1 = 1,
y0 = 0, y1 = 1,
xref = 'paper',
yref = 'paper'
)
)
)
plotly::subplot(
rep_len(list(p), nrows),
nrows = nrows,
margin = margin
)
}
generate_subplot(2)
generate_subplot(4)
generate_subplot(8)
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/plotly.R のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
save_image Error オープン
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
plotly/plotly.R の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
r-lib/pkgdepends#485 · コメント 3 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
beginners blocker
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enviPathR オープンBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
Bioconductor/BiocContributions#207 · コメント 6 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
datacarpentry/semester-biology#1255 ·