Hi,
New to plotly, I’ve got some troubles with the barmode=‘group’
I have 2couples of 2 traces (one group is +, the other is -) and I would like to group them by 2. With the barmode group they stay as a stack of 4…
Any idea to set the 4 bars on 2 lines instead of 4, to get a yaxis symetry ?
(I would like get down all the left bars of 2 lines)
https://plot.ly/~aut0wash/0/role-vs-gpm-xpm-repartition/#/
team1g = np.array([600, 623, 653, 650, 670])
team2g = np.array([600, 623, 653, 650, 670])
team1p = np.array([-578, -541, -411, -322, -230])
team2p = np.array([-578, -541, -360, -312, -170])
y = ["Carry", "Mid", "Offlane", "Support 4", "Support 5"]
layout = go.Layout(yaxis=go.layout.YAxis(title='Role'),
xaxis=go.layout.XAxis(
range=[-1200, 1200],
tickvals=[-1000, -700, -300, 0, 300, 700, 1000],
ticktext=[1000, 700, 300, 0, 300, 700, 1000],
title='GPM XPM repartition'),
barmode='group',
bargap=0.15,
bargroupgap=0.1)
data = [go.Bar(y=y,
x=team1g,
orientation='h',
name='Team Liquid GPM',
hoverinfo='x',
marker=dict(color='powderblue')
),
go.Bar(y=y,
x=team2g,
orientation='h',
name='Team Secret GPM ',
hoverinfo='x',
marker=dict(color='darkgreen')
),
go.Bar(y=y,
x=team1p,
orientation='h',
name='Team Liquid XPM',
text=-1 * team1p.astype('int'),
hoverinfo='text',
marker=dict(color='teal')
),
go.Bar(y=y,
x=team2p,
orientation='h',
name='Team Secret XPM',
text=-1 * team2p.astype('int'),
hoverinfo='text',
marker=dict(color='seagreen')
)]
py.iplot(dict(data=data, layout=layout), filename='gg')
Thx u for reading, hope I expressed good enough !