plotly / plotly/plotly.R

add_annotations doesn't respect log scale

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

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

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

説明

When using add_annotations with a log scale, the coordinates of the annotations are not automatically log-transformed.

exp_dat <- data.frame(x = 0:100, 
                      y = exp(0:100))
ann_dat <- data.frame(x = c(1, 10, 100), 
                      y = exp(c(1, 10, 100)),
                      label = c(1, 10, 100))

plot_ly(type = "scatter", mode = "lines+markers") %>%
  add_lines(., data = exp_dat, x = ~x, y = ~y) %>%
  add_annotations(., data = ann_dat, x = ~x, y = ~y, text = ~label) %>%
  layout(., yaxis = list(type = "log"))

The desired result can be obtained by manually log-transforming the coordinates, but it would be more intuitive if this wasn't necessary.

plot_ly(type = "scatter", mode = "lines+markers") %>%
  add_lines(., data = exp_dat, x = ~x, y = ~y) %>%
  add_annotations(., data = ann_dat, x = ~x, y = ~log10(y), text = ~label) %>%
  layout(., yaxis = list(type = "log"))

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

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

はじめの一歩

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

調査の方向性

提供された R の例を add_annotations と対数 y 軸で再現し、次に add_annotations のエントリポイントとアノテーション座標の処理方法を調べます。y 値を手動で変換せずに、対数スケール上でアノテーションが正しく揃えば完了です。

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

評価

技術スタック
r
領域
data-visualization
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

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

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