【发布时间】:2021-09-03 18:33:45
【问题描述】:
目前我的代码如下所示:
library(plotly)
count = data.frame(
row.names = c("Cell1", "Cell2", "Cell3", "Cell4", "Cell5", "Cell6"),
Gene1 = c(10, 11, 8, 3, 2, 1),
Gene2 = c(6, 4, 5, 3, 2.8, 1),
Gene3 = c(12, 9, 10, 2.5, 1.3, 2),
Gene4 = c(5, 7, 6, 2, 4, 7),
stringsAsFactors = FALSE
)
threeD = plotly::plot_ly(
data = count,
x = ~Gene1,
y = ~Gene2,
z = ~Gene3,
type = "scatter3d",
mode = "markers",
marker = list(size = 20),
color = row.names(count)
)
threeD
我想让标记随距离缩放。因此,离“我”最近的标记更大(Cell1 和 Cell 2),而远离“我”的标记显得更小(Cell5 和 Cell6)。这将实现更逼真的 3D 感觉。
【问题讨论】:
标签: r plot plotly bioinformatics scatter3d