plotly / plotly/plotly.R

annotation_custom in ggplot not supported by plotly

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

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

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

説明


Hi all,
I have a line of code to draw a rectangle, with a gradient color scheme, onto a ggplot figure using annotation_custom. However, this is not supported (and does not appear) when I make my figure interactive with ggplotly.

I am having trouble finding another solution for making this same shape that appears in the static figure in the interactive figure. Is there a way that ggplotly can support custom annotations?
Thank you!

g <- rasterGrob(matrix(c(bluepal), nrow = 1), 
                                 width=unit(1,"npc"), height = unit(1,"npc"), 
                                 interpolate = TRUE) #make a gradient of blue colors 

annotation_custom(g, xmin=2.7, xmax=7.5, ymin=20, ymax=22)
<img width="379" alt="Screen Shot 2021-08-12 at 6 17 45 PM" src="https://user-images.githubusercontent.com/22037535/129281870-c665dea2-0c82-4818-86e2-24d311578342.png">


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

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

はじめの一歩

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

調査の方向性

まず、rasterGrob、annotation_custom、ggplotly を使用して提供された R の例を再現し、静的な ggplot とインタラクティブな結果を比較します。カスタムアノテーションをサポートできるかどうかを判断し、インタラクティブな図にグラデーションの矩形が表示されることを確認します。

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

評価

技術スタック
r
領域
data-visualization
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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