这是我使用的程序:
library(plotly) mydata = read.csv("data_to_plot.txt") df = as.data.frame(mydata) p <- df %>% group_by(X) %>% plot_ly(x = ~Y, y = ~X, z = ~Z, type = "scatter3d", mode = "lines") p以下是mydata"的摘录:
and below is an excerpt of "mydata":
df[1:12,]X Y Z1 1 0.2818017 0.00059938842 1 0.2832173 0.00078964213 1 0.2846330 0.00102938494 1 0.2860487 0.00132824625 1 0.2874643 0.0016969544
df[1:12,] X Y Z 1 1 0.2818017 0.0005993884 2 1 0.2832173 0.0007896421 3 1 0.2846330 0.0010293849 4 1 0.2860487 0.0013282462 5 1 0.2874643 0.0016969544
我想在 X 轴上反转 X 值,但找不到如何修改我的程序.plotly 语法的细节对我来说非常模糊.有人能提供一些帮助吗?非常感谢.
I would like to have the X values reversed on the X-axis, but can't find how to modify my program. Details of the plotly syntax are quite obscure to me. Could someone afford some help? Many thanks.
绘制的数据:
推荐答案您可能正在寻找layout(xaxis = list(autorange = "reversed").
You are probably looking for layout(xaxis = list(autorange = "reversed").
更多推荐
使用 plotly 时如何反转轴值?
发布评论