【发布时间】:2018-06-18 09:44:05
【问题描述】:
我有一个二维矩阵,我希望根据第一列逐列绘制,我可以使用 matplot 绘制它,有没有办法使用 plotly 做类似的事情,我尝试通过将它们添加为跟踪来使用但它覆盖了没有添加它们的痕迹。
mat <- array(rnorm(10*10*10), dim=c(10, 10, 10))
df <- data.frame( 500*(1:10))
for(i in 3:5){
for(j in 4:5){
df <- cbind(df,mat[1:10,i,j])
}
}
matplot(x= df[,1], y= as.matrix(df[-1]), type='l')
# plot_ly(y= as.matrix(df[-1]), x= df[,1] ,type="scatter", mode="markers+lines")
【问题讨论】: