# X-axis mismatch for multitrace plot with plotly express

**URL:** <https://community.plotly.com/t/x-axis-mismatch-for-multitrace-plot-with-plotly-express/55711>\
**Category:** 📊 Plotly Python\
**Created:** [August 20, 2021, 10:41am UTC](https://community.plotly.com/t/x-axis-mismatch-for-multitrace-plot-with-plotly-express/55711 "2021-08-20T10:41:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![meatplot](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@meatplot](https://community.plotly.com/u/meatplot)\
**Post date:** [August 20, 2021, 10:41am UTC](https://community.plotly.com/t/x-axis-mismatch-for-multitrace-plot-with-plotly-express/55711/1 "2021-08-20T10:41:52Z")

</div>

Hi all. I am still new to plotly/px, so apologies if this is a simple fix.

I have a strip plot. I want to overlay bars representing the mean of each group. Problem: the bars and the strip plot dots do not line up. This is especially noticeable when there are a lot of groups.

```auto
fig = px.strip(df, x='x', y='value', color = 'group')
df_agg = df.groupby(by = ['x', 'group'], sort = False)['value'].agg('mean').reset_index()
bar_fig = px.bar(df_agg, x='x', y='value', color = 'group')
for bar_data in bar_fig.data:
    bar_data['marker']['color'] = 'silver'
    bar_data['showlegend'] = False
    fig.add_trace(bar_data)  

```

 ![newplot (8)](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/4/2/428f2d02b99688865d4817159f0b688702378ac3.png)
