plotly / plotly/plotly.R

ggplotly unable to handle multiple legends properly in layered charts generated by ggplot2

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

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

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

説明

From the example in http://bxhorn.com/legends-ggplot/#managing-multiple-legends-in-a-layered-chart

# Multiple Legends
# load data
data(diamonds)
# calc quantiles with specified probabilities
new.prob <- c(0.90, 0.95, 0.99)
cut.probs <- plyr::ddply(diamonds, .(cut), numcolwise(quantile, probs = new.prob))[, c("cut", "price")]
cut.probs <- transform(cut.probs, quantile = c("P90", "P95", "P99"))
# layered graph
gg<-ggplot(diamonds, aes(cut, price)) + 
  geom_boxplot(aes(fill = factor(cut))) + 
  geom_point(data = cut.probs, aes(cut, price, color = factor(quantile)), size = 5) +
  scale_fill_discrete(name = "Quality of the Cut") +
  scale_color_discrete(name = "My Quantiles")
gg
plotly::ggplotly(gg)
  1. Multiple legend titles are clustered together
  2. Multiple legends are not separated
  3. There is extra text ",1" in legend labels

This is the ggplot2 output:
image

This is the ggplotly output:
newplot

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

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

はじめの一歩

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

調査の方向性

用意されている層構造の ggplot2 例と ggplotly(gg) エントリポイントから始め、その出力を ggplot2 の出力と比較します。2 つの aesthetics とその scale names がどのように legends になるかを追跡します。タイトルが分離され、legends が別々になり、余分な ",1" テキストがなくなれば完了です。

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

評価

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

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

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