【发布时间】:2021-12-17 18:49:31
【问题描述】:
我正在尝试使用 RStudio 创建 3D 绘图。 到目前为止,我制作的内容与此类似(代码来自https://plotly.com/r/3d-scatter-plots/)
library(plotly)
mtcars$am[which(mtcars$am == 0)] <- 'Automatic'
mtcars$am[which(mtcars$am == 1)] <- 'Manual'
mtcars$am <- as.factor(mtcars$am)
fig <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec, color = ~am, colors = c('#BF382A', '#0C4B8E'))
fig <- fig %>% add_markers()
fig <- fig %>% layout(scene = list(xaxis = list(title = 'Weight'),
yaxis = list(title = 'Gross horsepower'),
zaxis = list(title = '1/4 mile time')))
fig
但是,我还想编辑主题/背景。就像this 一样,我想要没有任何网格线的清晰背景。我知道这张图片可能是由scatter3D 生成的,所以我想知道 plot_ly 是否有类似的功能?像主题、bgcolor 等?如何删除网格线?
【问题讨论】: