![](/img/trans.png)
[英]Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y'
[英]Error with plotly subplot: Error in xy.coords(x, y) : 'x' is a list, but does not have components 'x' and 'y'
嘗試在 R 中使用 plotly 子圖時出現錯誤,我不知道為什么。 如果我嘗試繪制兩個情節圖 b 和 c:
library(plotly)
df <- data.frame("A"=1:10, "B"=11:20, "C"=21:30)
b_plot <- plot_ly(df) %>%
add_trace(x=~A, y=~B)
c_plot <- plot_ly(df) %>%
add_trace(x=~A, y=~C)
它們自己工作得很好,但是當我嘗試在子圖中並排繪制它們時:
p <- subplot(b_plot, c_plot)
我收到錯誤:
Error in xy.coords(x, y) : 'x' is a list, but does not have components 'x' and 'y'
我什至無法讓Plotly 示例工作。 任何幫助表示贊賞,謝謝!
原來該函數被 Hmisc 包中的plotly::subplots(...)
函數覆蓋,因此更改為plotly::subplots(...)
解決了問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.