For a line plot (with one line, sorted data) there should be four “options”: both the data and the x-axis can be sorted from high to low and vice versa.
In the example below, I can easily reverse the ‘data’, but not the x-axis (it always starts at 0 in the bottom left corner).
I tried out a few things with xflip
and attr(traceorder="reversed")
, but was not successful. What am I missing?
using PlotlyJS
nn=1000
simulated_data=rand(nn).^3
sort!(simulated_data)
probabilityAxis=ones(nn).-collect(1:nn)./nn
layout = Layout(;xflip=false) #,legend=attr(traceorder="reversed"))
data=scatter(x=probabilityAxis,y=simulated_data)
PlotlyJS.plot(data,layout)
#this works as expected
data=scatter(x=probabilityAxis,y=reverse(simulated_data))
PlotlyJS.plot(data,layout)
#this looks the same as the previous plot. Why?
data=scatter(x=reverse(probabilityAxis),y=simulated_data)
PlotlyJS.plot(data,layout)