【发布时间】:2016-04-08 17:56:36
【问题描述】:
我实际上是从 plotly R 示例页面复制并粘贴此代码,它会产生错误。似乎无法使其正常工作。
iris$id <- as.integer(iris$Species)
p <- plot_ly(iris, x = Petal.Length, y = Petal.Width,
group = Species,
xaxis = paste0('x', id), mode = 'markers')
p <- subplot(p)
Error in locator(2) : plot.new has not been called yet
p
Warning message:
In par(old.par) : calling par(new=TRUE) with no plot
这是我正在使用的包版本:
packageVersion('plotly')
[1] ‘3.4.13’
有什么想法吗?
【问题讨论】:
-
适用于 plotly_3.4.3 ggplot2_2.1.0
-
我正在使用来自 Github 的开发版本,因为在该版本而不是 CRAN 版本中修复了 subplot 中的错误。我认为 CRAN 的最新版本是 3.4.1。有什么办法可以通过从 github 安装降级到 3.4.3?没试过。
-
这也是我正在使用的开发版本,但比你的旧 :-)
-
对....在我安装了 3.4.9 dev 的另一台机器上试过,这似乎也有效。在最近的开发版本中必须打破某些东西。刚刚在 Github 上提交了问题报告。谢谢。
-
经过进一步检查,plotly::subplot() 被 Hmisc::subplot() 覆盖,这是我在 cut2() 代码中使用的一个包。道歉。