Ggplotly does not always make a legend correctly for where there are points and lines
オープン
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Ggplotly does not always make a legend correctly for where there are points and lines. Sometimes it only makes the legend key based on either geom_point or geom_line, whichever is the first layer. Below is an example where it doesn't work. It seems to fix it if the data is arranged by the x variable. It'd be good if it worked for however the data was arranged.
library(dplyr)
library(ggplot2)
library(plotly)
#This doesn't work: the legend is based only on the first geom shape
plot_data <- iris %>%
as_tibble() %>%
janitor::clean_names()
plot <- ggplot(data = plot_data, aes(petal_width, petal_length, col = species)) +
geom_point() +
geom_line()
plotly::ggplotly(plot)

plot_data <- iris %>%
as_tibble() %>%
janitor::clean_names() %>%
arrange(petal_width)
plot <- ggplot(data = plot_data, aes(petal_width, petal_length, col = species)) +
geom_point() +
geom_line()
plotly::ggplotly(plot)

コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された R の例を plotly::ggplotly で再現し、並べ替えていない iris データと petal_width で並べ替えたバージョンを比較します。データ行の順序にかかわらず、凡例が点レイヤーと線レイヤーの両方を正しく表すようになれば、issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- r
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100