`colors` argument to `add_trace` is only respected if the trace type *isn't* specified in the `plot_ly` call
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- r
調査の方向性
iris を使って 2 つの plot_ly/add_trace の例を再現し、生成されたパレットを比較します。plot_ly と add_trace のエントリポイント、特に明示的な type="scatter" パスにおける色の処理を追跡します。両方の呼び出し形式が一貫して colors="Blues" を受け入れ、異なる例に対する回帰テストのカバレッジがあることを完了条件とします。
索引モデルが issue の本文から書いたものです。
説明
I'd expect these two lines of code to produce the same output, but only the first does what I expect (uses the colors argument to pick a palette for the points):
plot_ly(data = iris) %>%
add_trace(x = ~Sepal.Length, y = ~Sepal.Width, color = ~Species, colors = "Blues", mode = "markers")
plot_ly(data = iris, type="scatter") %>%
add_trace(x = ~Sepal.Length, y = ~Sepal.Width, color = ~Species, colors = "Blues", mode = "markers")
This seems backwards since I added the type="scatter" to avoid the warning about guessing the trace type, only to have my palette disappear.
Curiously, this behavior isn't present if everything is specified in the same call:
plot_ly(data = iris, x = ~Sepal.Length, y = ~Sepal.Width, color = ~Species, colors = "Blues")
plot_ly(data = iris, x = ~Sepal.Length, y = ~Sepal.Width, color = ~Species, colors = "Blues", type="scatter")
both return
Is colors the correct way to pass a palette to a specific layer? In other places it seems like it's actually colorspace? I know scatter doesn't have a colors argument in schema() (e.g. #1699) but clearly it's working when the type is inferred and I would like to provide a palette...
- 主要言語
- 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 ·