Scatter points at wrong coordinates when combining multicategory axis and colour
オープン
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hi,
When combining a multicategory axis and colour coding in a scatter plot, the mapping of the points seem to go wrong.
In p2 in the example below, the points appear at coordinates that are not in the data.
The problem can be resolved by first ordering the data (p4).
library(plotly)
d <- data.frame(
l1 = letters[11:15],
l2 = c('a', 'a', 'a', 'a', 'b'),
y = 1:10,
col = LETTERS[11:15],
stringsAsFactors = F
)
p1 <- plot_ly(
data = d,
x = list(~l2, ~l1),
y = ~y,
# color = ~col,
type = 'scatter',
mode = 'markers'
)
p2 <- plot_ly(
data = d,
x = list(~l2, ~l1),
y = ~y,
color = ~col,
type = 'scatter',
mode = 'markers'
)
d <- d[order(d$l1), ]
p3 <- plot_ly(
data = d,
x = list(~l2, ~l1),
y = ~y,
# color = ~col,
type = 'scatter',
mode = 'markers'
)
p4 <- plot_ly(
data = d,
x = list(~l2, ~l1),
y = ~y,
color = ~col,
type = 'scatter',
mode = 'markers'
)
subplot(p1, p2, p3, p4, nrows = 2, margin = .07) %>%
layout(annotations = list(
list(x = 0.1 , y = 1.05, text = "unordered/uncolored", showarrow = F, xref='paper', yref='paper'),
list(x = 0.9 , y = 1.05, text = "unordered/colored", showarrow = F, xref='paper', yref='paper'),
list(x = 0.1 , y = .45, text = "ordered/uncolored", showarrow = F, xref='paper', yref='paper'),
list(x = 0.9 , y = .45, text = "ordered/colored", showarrow = F, xref='paper', yref='paper')
)
)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された再現可能な R の例を実行し、順序付けされていない/色付きの散布図を他のパネルと比較します。複数カテゴリの軸と色を組み合わせた場合の散布図の処理を追跡します。入力データの座標に点が保持され、事前の順序付けを必要としなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- r
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100