使用plotly时如何反转轴值?

And*_*rew 6 axis reversing plotly

这是我使用的程序:

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  
Run Code Online (Sandbox Code Playgroud)

以下是“ mydata”的摘录:

df [1:12,]
XYZ
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语法的细节对我来说还是很模糊的。有人可以提供一些帮助吗?非常感谢。

绘制的数据: 在此处输入图片说明

小智 17

万一有人到达这里寻找 python 中某些子图的反转轴。

fig.update_yaxes(autorange="reversed", row, col)
Run Code Online (Sandbox Code Playgroud)