Box plot space between boxes

Hi,
Im trying to make a box plot for two separate Funds in one chart. The data for each of the funds are stored in a separate dataFrame and they have the same column names (Error types). im trying to group each of the error categories depending on the fund they belong to. The issue is that the space between each of the error categories are too big. is there any way to make them smaller? my code:

 colors = ['#ff7200', '#434871', '#FF007A', '#9945FF', 'brown', 'salmon']
 for temp, nam in enumerate(df.columns.to_list()):
        deta = df[nam].dropna() * 100.00
        deta1 = df1[nam].dropna() * 100.00
        fig.add_trace(go.Box(
            y=deta.round(4).to_list(),
            boxpoints='outliers', 
            quartilemethod="inclusive",
            boxmean=True,
            jitter=0.3, 
            name=nam,
            legendgroup=nam,
        ))
        fig.add_trace(go.Box(
            y=deta1.round(4).to_list(),
            boxpoints='outliers',  
            quartilemethod="inclusive",
            boxmean=True,
            jitter=0.3, 
            marker_color=colors[temp],
            name=nam,
            showlegend=False,
            legendgroup=nam,
        ))
fig.add_annotation(text=f'As at {today_STR}', align='left', showarrow=False,
                       font=dict(family="Open Sans", size=12),
                       xref='paper', yref='paper', xanchor='left', yanchor="middle", x=-0.05, y=-0.149)
fig.update_traces(opacity=0.75)
fig.update_layout(autosize=True, plot_bgcolor="#FFFFFF", title='Error Breakdown', boxmode='group', boxgroupgap=0.8, boxgap=0,  )
fig.show()

the chart:

Wouldn’t a smaller gap in the box group improve this?

fig.update_layout(autosize=True, 
                  plot_bgcolor="#FFFFFF", 
                  title='Error Breakdown',
                  boxmode='group', 
                  boxgroupgap=0.2, # update
                  boxgap=0)
1 Like

Thanks it worked!