plotly / plotly/plotly.R

Setting anchor = "free" in R subplot() causes the graph to disappear

オープン
#1,768 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

plotly.js
主要言語
R
スター
2.7k
フォーク
641
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm trying to build a subplot of stacked scatter plots, where there are multiple axes on each scatter plot.

Below is an example of the type of plot. To position the yaxis side-by-side, I have layout(yaxis(anchor = "free")) set am using position to place the axis.

image

All my attempts to set anchor = "free" in subplots left my plot space completely blank. Some testing revealed that even a subplot constructed from a single plot will not display if anchor="free"

Please see below REPREX.

require(plotly)
df <- data.frame(x = 1:10, y = 1:10, y2 = 10:19)
plt <- plot_ly(data = df) %>%
  add_trace(x = ~x, y = ~y,
            mode = "markers", type = "scatter",
            yaxis = "y") %>%
  add_trace(x = ~x, y = ~y2,
            mode = "markers", type = "scatter",
            yaxis = "y2") %>%
  layout(
    xaxis = list(
      domain = c(.12, .88)
    ),
    yaxis = list(
      title = "y_1"
    ),
    yaxis2 = list(
      title = "y_2",
      anchor = "free",
      position = .10,
      overlaying = "y"
    ),
    margin = list(
      pad = 60
    )
  )
subplot(plt)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提供されている R reprex を plot_ly()、layout()、subplot() とともに実行し、anchor = "free" によって空のプロットが生成されることを確認します。次に、subplot() が yaxis と yaxis2 の設定をどのように処理しているか、特に anchor、position、overlaying を追跡します。subplot がトレースを描画し、自由に位置付けられた軸を維持できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
r
領域
data-visualization
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。