Here is the program I used:
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
and below is an excerpt of "mydata":
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
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.
Data plotted:
Go to 'Axes', then 'Tick Labels' and depending on the axis you want to change, select X, Y, or 'ALL'.
Scatter() function to make a scatter plot. The go. Figure() function takes in data as input where we set the mode as 'lines' using mode='lines'. We have used the magic underscore notation i.e layout_yaxis_range=[-8,8] to set the y-axis range from -8 to 8.
You are probably looking for
layout(xaxis = list(autorange = "reversed")
.
In case someone reaches here looking for reversing axis for some subplots in python.
fig.update_yaxes(autorange="reversed", row, col)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With