r - plot_ly:如何水平绘制子图?
问题描述
我无法用plot_ly、scatter3d 创建一个子图,每个图并排在水平线上。
library(plotly)
mtcars$am[which(mtcars$am == 0)] <- 'Automatic'
mtcars$am[which(mtcars$am == 1)] <- 'Manual'
mtcars$am <- as.factor(mtcars$am)
fig1 <- plot_ly(mtcars, x = ~wt, y = ~hp, z = ~qsec, color = ~am, colors = c('#BF382A', '#0C4B8E'), type = "scatter3d", mode = "markers")
fig2 <- plot_ly(mtcars, x = ~hp, y = ~wt, z = ~qsec, color = ~am, colors = c('#BF382A', '#0C4B8E'), type = "scatter3d", mode = "markers")
subplot(fig1, fig2)
解决方案
推荐阅读
- spring-boot - Spring Boot 2.3.0.M4 分层 jar 缺少一层,Docker 在缺少目录时失败
- bash - 如何在 bash 中通读两个文件以创建嵌套输出列表以并行化命令
- python - 如何在没有 for 循环的情况下遍历列表
- ios - CloudKit + CoreData 用于超过 100K 的许多记录
- spring-boot - Spring获取打开的websocket连接
- javascript - Javascript 未被调用
- java - 如何在 Java Date 中处理带有额外毫秒的时间戳
- javascript - 带有 yargs 的选项的可选参数
- nginx - NGinx RTMP 直播流文本叠加并推送到多个
- python - SQLite 动态插入多个值