plotly / plotly/plotly.R

ColorScale Will Not Change If Specifying with colorscale = c('hexcode1', 'hexcode2')

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

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

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

説明

Hi,

After following the guide here, https://plotly.com/r/3d-scatter-plots/, I found that, when specifying color scale with colorscale = c('hexcode1', 'hexcode2') will not have changes to the color scale, yet the default palette names such as 'Rainbow' will work. In this case, it would not be possible to self-define the 2 end points of the color scale. Please feel free to run the R codes below to see what I mean.


library(dplyr)
library(plotly)

fig <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec,
               marker = list(color = ~mpg, 
                             #colorscale = c('#FF0000', '#00FF72'), 
                             #colorscale ='Rainbow',
                             colorscale = c('#132B43', '#56B1F7'),
                             showscale = TRUE))
fig <- fig %>% add_markers()
fig <- fig %>% layout(scene = list(xaxis = list(title = 'Weight'),
                                   yaxis = list(title = 'Gross horsepower'),
                                   zaxis = list(title = '1/4 mile time')),
                      annotations = list(
                        x = 1.13,
                        y = 1.05,
                        text = 'Miles/(US) gallon',
                        xref = 'paper',
                        yref = 'paper',
                        showarrow = FALSE
                      ))
fig

Just wondering if this is a bug or may be there needs some updates to the guide?

Thanks,

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

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

はじめの一歩

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

調査の方向性

まず、3D散布図ガイドに用意されているRの例を実行し、カスタムの16進数colorscaleと動作するRainbowパレットを比較します。colorscaleがplot_ly()とadd_markers()を通じてどのように渡されるかを追跡します。指定された2つの端点色がマーカーのcolorscaleを目に見える形で制御するか、ガイドにサポートされている構文が記載されていれば完了です。

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

評価

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

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

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