I made a bar plot where x is the same but with two different y's.
#plot optimazied and actual time difference
import plotly.graph_objects as go
from plotly.offline import iplot
from plotly.subplots import make_subplots
# set up plotly figure
fig = make_subplots(1,1)
# add first bar trace at row = 1, col = 1
fig.add_trace(go.Bar(x=models, y=df['OT'],
name='Standard time',
marker_color = 'green',
opacity=0.4,
marker_line_color='rgb(8,48,107)',
marker_line_width=2),
row = 1, col = 1)
fig.add_trace(go.Bar(x=models, y=df['HP'],
name='Under Process time',
marker_color = 'red',
opacity=0.4,
marker_line_color='rgb(8,48,107)',
marker_line_width=2),
row = 1, col = 1)
fig.update_layout(barmode='group', xaxis_tickangle=-45, xaxis={'categoryorder':'total descending'})
fig.update_xaxes(type='category')
fig.show()
I want to sort the x axis with respect to the ratio between the two y's.
