plotly / plotly/plotly.R

Cannot modify xaxis and yxais labels for type="scatter3d"

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

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

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

説明


Brief description of the problem:
I cannot modify the labels for the x-axis and y-axis. Copied from web page fig1 ; xaxis = list(title = 'XXXXXXXXXXXX') and yaxis = list(title = 'YYYYYYYYYYY') they render properly. When rendering as fig2: plot_ly(type="scatter3d",mode = "markers" ; the labels for x an y axis are incorrect. Both plots print in rstudio but fig2 's axis labels are incorrect. No errors are presented. Please see attacthed PDF with screen prints.

[plotly axis labels.pdf](https://github.com/plotly/plotly.R/files/12268079/plotly.axis.labels.pdf)

# insert reprex here
``` r
[plotly axis labels.pdf](https:/
[plotly axis labels.pdf](https://github.com/plotly/plotly.R/files/12268082/plotly.axis.labels.pdf)
/github.com/plotly/plotly.R/files/12268078/plotly.axis.labels.pdf)

#fig1
# clean out environemnt
rm(list = ls(all.names = TRUE))

library(plot3D)
library(plotly)
#> Loading required package: ggplot2
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
library(ggplot2)
library(stats)
library(stats4)
library(graphics)
library(crosstalk)
library(rgl)
library(plotrix)
#> 
#> Attaching package: 'plotrix'
#> The following object is masked from 'package:rgl':
#> 
#>     mtext3d
library(tidyr)
library(RColorBrewer)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(readr)

##########################
# resolve library conflicts
conflicted::conflicts_prefer(plotly::filter)
#> [conflicted] Will prefer plotly::filter over any other package.
conflicted::conflicts_prefer(plotly::layout)
#> [conflicted] Will prefer plotly::layout over any other package.


fig1 <-  plot_ly(data = iris ,x =  ~Sepal.Length, y = ~Sepal.Width, color = ~Species, type = 'scatter', mode = 'markers')%>%
    layout(title = 'type = scatter, mode = markers', plot_bgcolor = "#e5ecf6", xaxis = list(title = 'XXXXXXXXXXXX'),
           yaxis = list(title = 'YYYYYYYYYYY'), legend = list(title=list(text='<b> Species of Iris </b>')))
fig1
#> PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.

Created on 2023-08-05 with reprex v2.0.2



```r
# insert reprex here
``` r
#fig2
# clean out environemnt
rm(list = ls(all.names = TRUE))

library(plot3D)
library(plotly)
#> Loading required package: ggplot2
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
library(ggplot2)
library(stats)
library(stats4)
library(graphics)
library(crosstalk)
library(rgl)
library(plotrix)
#> 
#> Attaching package: 'plotrix'
#> The following object is masked from 'package:rgl':
#> 
#>     mtext3d
library(tidyr)
library(RColorBrewer)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(readr)

##########################
# resolve library conflicts
conflicted::conflicts_prefer(plotly::filter)
#> [conflicted] Will prefer plotly::filter over any other package.
conflicted::conflicts_prefer(plotly::layout)
#> [conflicted] Will prefer plotly::layout over any other package.


fam17npg02 <- data.frame(x=c(77,77),y=c(61,77),z=c(77,79),p=c("np","np"),pcolor=c("BLACK","BLACK"))   


fig2 <- plot_ly(type="scatter3d",mode = "markers",
                fam17npg02, 
                x = fam17npg02$x, 
                y = fam17npg02$y,
                z = fam17npg02$z, 
                name="fam17npg02",    
                opacity = 0.8, color = I(fam17npg02$pcolor)) %>% 
    layout(title = 'type = scatter3d, mode = markers', plot_bgcolor = "#e5ecf6", xaxis = list(title = 'XXXXXXXXXXXX'),
           yaxis = list(title = 'YYYYYYYYYYY'), legend = list(title=list(text='<b> Species of Iris </b>')))

fig2
#> PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.

Created on 2023-08-05 with reprex v2.0.2

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

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

はじめの一歩

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

調査の方向性

まず、提供されている fig1 と fig2 の reprex を実行し、plot_ly(type="scatter3d") が layout xaxis と yaxis のタイトルをどのように扱うかを比較します。scatter3d の plotly.R エントリポイントと layout の軸処理を調査します。完了の条件は、2D の例を壊すことなく、要求された x 軸と y 軸のラベルが 3D プロットで正しく表示されることです。

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

評価

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

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

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