Color group does not appear in the animated plotly
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I am trying to plot an animated frame with plotly. The goal is to plot how some units (id) changes in two continuous variables AND one categorical. The problem arises because the third category appears not from the beginning. In the plot, the units with “type3” category do not appear on the plot after 2001 and the ‘type3’ entry does not appear in the legend. The code shows an example of the data structure and problem. The same problem with boxplot - only two categories are present for all frames.
The ideal result is appearing of all 3 groups form the beginning. For scatterplot, points should change the color and for boxplot there should be an empty space from the beginning for the third category or it should appear after reaching the proper year.
df <- data.frame(x = rnorm(50),
y = rnorm(50),
year = c(rep(2000, 10), rep(2001, 10), rep(2002, 10), rep(2003, 10), rep(2004, 10)),
id = rep(1:10, 5),
model = c(rep('type1', 5), rep('type2', 5), rep('type1', 5) , rep('type2', 5),
rep('type1', 3), rep('type2', 2), rep('type3', 5) ,
rep('type1', 4), rep('type2', 5), rep('type3', 1) ,
rep('type1', 3), rep('type2', 2), rep('type3', 5) ))
cols <- c(
"type1" = "#bc80bd",
"type2" = "#fdb462",
"type3" = "#b3de69"
)
plot_ly(df, x = ~x,
y= ~y,
color = ~model,
text = ~id,
frame = ~year,
opacity = .8,
marker = list(size = 10),
colors = cols,
type = 'scatter')
plot_ly(df,
y= ~y,
color = ~model,
frame = ~year,
opacity = .8,
colors = cols,
type = 'box')
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、アニメーション付きの散布図と箱ひげ図用に提供されている R の例を実行し、その後、年ごとのフレーム間でカテゴリ凡例とトレースを比較します。type3 が最初から一貫して処理され、散布図で期待される色と凡例の動作、および箱ひげ図で空または後から表示される状態が定義されていれば、issue は解決です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- plotly, r
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100