i have a dataframe with two columns. MachineID and Value. I sort the dataframe to descending order(machines with high values first) and plot the line chart. But still, it shows the x axis(MachineID 1 to 60, rather than taking the highest values MachineID first.)
To solve this error, changed the machineID column to string but still couldn't get the machines with High values first.
Sample dataframe:
MachineID Value
33 6.962754
16 6.955913
44 6.722355
31 6.320854
1 6.243701
9 5.894093
Mycode:
import plotly.express as px
fig = px.line(data, x="MachineID", y="Values")
fig.show()
Output for above code:
Required Output:
Machines with high values first and so on.