plotly / plotly/plotly.R

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

Đang mở
#2,284 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
R
Star
2.7k
Fork
641
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả


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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy các reprex fig1 và fig2 được cung cấp, rồi so sánh cách plot_ly(type="scatter3d") xử lý tiêu đề của layout xaxis và yaxis. Kiểm tra các entry point trong plotly.R cho scatter3d và việc xử lý các trục của layout; được xem là hoàn thành khi các nhãn trục x và y được yêu cầu hiển thị chính xác trên biểu đồ 3D mà không làm hỏng ví dụ 2D.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
r
Lĩnh vực
data-visualization
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.