plotly / plotly/plotly.R

Plotly Subplot Function Issue

Đang mở
#1,934 1 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ả

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form, but instead ask on the community forum http://community.plot.ly/c/api/r or stackoverflow http://stackoverflow.com.

Please include a minimal reprex. The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it. If you've never heard of a reprex before, start by reading https://github.com/tidyverse/reprex#readme, and follow the advice further down the page. Do NOT include session info unless it's explicitly asked for, or you've used reprex::reprex(..., si = TRUE) to hide it away.

Delete these instructions once you have read them.


I am trying to plot two plotly images side by side using the tutorial laid out here. However, I keep getting this error:

Warning messages:
1: No source found 
2: No config found 
3: 'layout' objects don't have these attributes: 'NA'
Valid attributes include:
'font', 'title', 'uniformtext', 'autosize', 'width', 'height', 'margin', 'paper_bgcolor', 'plot_bgcolor', 'separators', 'hidesources', 'showlegend', 'colorway', 'datarevision', 'uirevision', 'editrevision', 'selectionrevision', 'template', 'modebar', 'meta', 'transition', '_deprecated', 'clickmode', 'dragmode', 'hovermode', 'hoverdistance', 'spikedistance', 'hoverlabel', 'selectdirection', 'grid', 'calendar', 'xaxis', 'yaxis', 'ternary', 'scene', 'geo', 'mapbox', 'polar', 'radialaxis', 'angularaxis', 'direction', 'orientation', 'editType', 'legend', 'annotations', 'shapes', 'images', 'updatemenus', 'sliders', 'colorscale', 'coloraxis', 'metasrc', 'barmode', 'bargap', 'mapType'

My plotly objects are defined in the same way as follows:

  log10_plot <- plot_ly(data=log10numi_frame,x=log10numi_frame$`Log10 Cell Index`,y=log10numi_frame$`Log10 nUMI`, type="scatter", mode = "lines", name=paste0(sample," nUMI"), line=list(color="#000000")) %>% layout(autosize = F, width = 700, height = 350, xaxis = list(title = "Cells in decreasing order by genic UMI count"), yaxis= list(title = "Log10(Genic UMI count)"))
  if(! is.na(kneedle_cumfrac_knee)){
    log10_plot <- add_segments(log10_plot,x=kneedle_cumfrac_knee, xend =kneedle_cumfrac_knee, y=min(log10numi_frame$`Log10 nUMI`), yend=max(log10numi_frame$`Log10 nUMI`), name=paste0("Kneedle (Cumulative Fraction) Knee (",round(kneedle_cumfrac_knee,digits=1),")"), text = "Kneedle (Cumulative Fraction) Knee", line=list(color="#E69F00"))
  }
  if(! is.na(kneedle_log10_knee)){
    log10_plot <- add_segments(log10_plot,x=kneedle_log10_knee, xend = kneedle_log10_knee,y=min(log10numi_frame$`Log10 nUMI`), yend=max(log10numi_frame$`Log10 nUMI`), name=paste0("Kneedle (Log10) Knee (",round(kneedle_log10_knee,digits=1),")"), text = "Kneedle (Log10) Knee", line=list(color="#56B4E9"))
  }
  if(! is.na(second_deriv_min_knee)){
    log10_plot <- add_segments(log10_plot, x=second_deriv_min_knee, xend = second_deriv_min_knee, y=min(log10numi_frame$`Log10 nUMI`), yend=max(log10numi_frame$`Log10 nUMI`), name=paste0("Second Derivative Knee (", round(second_deriv_min_knee,digits=1),")"), text = "Second Derivative Knee", line=list(color="#009E73"))
  }
  #if(! is.na(DropletUtils_knee)){
  #  log10_plot <- add_segments(log10_plot,x=DropletUtils_knee, xend = DropletUtils_knee,y=min(log10numi_frame$`Log10 nUMI`), yend=max(log10numi_frame$`Log10 nUMI`), name=paste0("DropletUtils Knee (",round(DropletUtils_knee,digits=1), ")"), text = "DropletUtils Knee")
  #}
  if(! is.na(DropletUtils_inflection)){
    log10_plot <- add_segments(log10_plot,x=DropletUtils_inflection, xend = DropletUtils_inflection,y=min(log10numi_frame$`Log10 nUMI`), yend=max(log10numi_frame$`Log10 nUMI`), name=paste0("DropletUtils (Inflection) Knee (",round(DropletUtils_inflection,digits=1),")"), text = "DropletUtils (Inflection) Knee", line=list(color="#F0E442"))
  }
  if(! is.na(emptydrops_num_cells)){
    log10_plot <- add_segments(log10_plot,x=emptydrops_num_cells, xend = emptydrops_num_cells, y=min(log10numi_frame$`Log10 nUMI`), yend=max(log10numi_frame$`Log10 nUMI`), name=paste0("DropletUtils (EmptyDrops) Knee (",round(emptydrops_num_cells,digits=1),")"), text = "DropletUtils (EmptyDrops) Knee", line=list(color="#0072B2"))
  }

Currently I am calling this when I get the error:

subplot(log10_plot, cum_frac_plot)

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 với mã R trong issue và lệnh gọi subplot(log10_plot, cum_frac_plot); kiểm tra cách subplot kết hợp các đối tượng plotly này, bao gồm cả các lệnh gọi add_segments. Tái hiện các cảnh báo được liệt kê và xác minh rằng kết quả hiển thị cả hai biểu đồ cạnh nhau mà không có các thuộc tính layout không hợp lệ.

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.