【发布时间】:2017-10-13 04:07:50
【问题描述】:
我第一次使用plotly 包来生成3D 绘图。尽管我正在学习本教程,但绘图点不会出现在 RStudio 查看器中。只是一个空的网格。
library(plotly)
packageVersion('plotly')
#[1] ‘4.6.0’
mtcars$am[which(mtcars$am == 0)] <- 'Automatic'
mtcars$am[which(mtcars$am == 1)] <- 'Manual'
mtcars$am <- as.factor(mtcars$am)
p <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec, color = ~am, colors = c('#BF382A', '#0C4B8E')) %>%
add_markers() %>%
layout(scene = list(xaxis = list(title = 'Weight'),
yaxis = list(title = 'Gross horsepower'),
zaxis = list(title = '1/4 mile time')))
但是,当我在网络浏览器中打开绘图时,点显示得很好。
我在这里看到一个类似的问题:Plotly in RStudio viewer
但是更新到最新版本的 RStudio 后,点仍然没有出现。我正在使用 R 版本 3.3.3
【问题讨论】: