Missing colors in heatmap if values are the identical
オープン
まだ誰も着手していません。
- 主要言語
- R
- スター
- 2.7k
- フォーク
- 641
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hello!
when creating a heatmap where values are all the same on a continuous scale, I get the expected colors from ggplot. However, when I put my ggplot into ggplotly, the colors are gone and it's all gray. Only happends, when values are identical. Happens with version 4.9.3 of plotly.
library(ggplot2)
library(dplyr)
library(plotly)
data <- tibble(hour = c(1, 1, 2, 2), day = c(1, 2, 1, 2), evaluation = c(1, 1, 1, 1))
g <- ggplot(data = data, mapping = aes(x = hour, y = day))
g <- g + geom_tile(aes(fill = evaluation), color = "white")
g <- g + scale_fill_gradientn(limits = c(0, 1), colours = c("red", "green"), name = "Availability")
print(g) # ok, all colors are green as expected
print(ggplotly(g)) # not ok, colors in heatmap are gray, expected to be green
Please let me know if you need more explanation or additional information to track this down.
Thank you and kind regards,
Heiko
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue にある再現可能な R の例から始め、評価値が同一である連続ヒートマップの ggplotly 変換を追跡します。ggplot と ggplotly の出力を比較し、変換されたタイルが灰色ではなく期待される緑色を使用していることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, r
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100