How to reverse axis values when using plotly?

前端 未结 4 791
一个人的身影
一个人的身影 2021-01-17 16:25

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) %>%
  plo         


        
相关标签:
4条回答
  • 2021-01-17 16:58

    You are probably looking for layout(xaxis = list(autorange = "reversed").

    0 讨论(0)
  • 2021-01-17 16:59

    You can solve this by continuing to rotate the plot using turntable rotation. Originally, the axes are oriented with the largest values facing you. As you rotate, one by one they will become oriented the other way, then go back to where they started. This may be why autorange = "reversed" doesn't work in 3d plots.

    0 讨论(0)
  • 2021-01-17 17:02

    At the moment reversed axis range in 3d is not supported in plotly. For this reason autorange = "reversed" doesn't work.

    0 讨论(0)
  • 2021-01-17 17:08

    You can rotate the plot by setting x=-x, and/or y=-y. You can then remove the minus sign in the plot by using tickvals = list(-x_ticks) and ticktext = list(x_ticks) in layout. Haven't found a way to remove the minus signal from the hovertext. But I guess I can't have it all =)

    0 讨论(0)
提交回复
热议问题