# Strange behaviour of two plots on one graph

**URL:** <https://community.plotly.com/t/strange-behaviour-of-two-plots-on-one-graph/57599>\
**Category:** 📊 Plotly Python\
**Created:** [October 15, 2021, 12:24pm UTC](https://community.plotly.com/t/strange-behaviour-of-two-plots-on-one-graph/57599 "2021-10-15T12:24:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SkyTiger](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/skytiger/32/5476_2.png) [@SkyTiger](https://community.plotly.com/u/SkyTiger)\
**Post date:** [October 15, 2021, 12:24pm UTC](https://community.plotly.com/t/strange-behaviour-of-two-plots-on-one-graph/57599/1 "2021-10-15T12:24:41Z")

</div>

This is my simple code:

```auto
name_a = df_a[names].unique()[0]
data.add_trace(
    go.Bar(
        x=df_a[xaxis_col],
        y=df_a[yaxis_col],
        name=name_a,
        hovertemplate="%{y:.3s}",
    )
)
data.add_trace(
    go.Scatter(
        x=df_b[xaxis_col],
        y=df_b[yaxis_col]
    )
)
figure = go.Figure(data=data)

```

And i’m getting this graph:

 ![2021-10-15 14.47.16 127.0.0.1 8c4a10992193](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/e/a/ea034e555461ea105ffab3d38b3e3432b018c59b.png)

df\_a:  
xaxis\_col | yaxis\_col  
01 | 3131  
02 | 1300  
03 | 8331  
04 | 3662  
05 | 3300  
09 | 3231  
12 | 450  
13 | 700  
14 | 1831

df\_b:  
xaxis\_col | yaxis\_col  
01 | 48993  
02 | 66462  
03 | 65562  
04 | 38700  
05 | 40731  
06 | 52031  
07 | 50531  
08 | 34062  
09 | 19700  
10 | 31381  
11 | 36793  
12 | 36000  
13 | 31500  
14 | 29931  
15 | 38300  
16 | 35800  
17 | 37481  
18 | 60974  
19 | 41700  
20 | 38300  
21 | 49262  
22 | 54200  
23 | 48631  
24 | 58662  
25 | 63481  
26 | 37931  
27 | 34062  
28 | 22450  
29 | 54112  
30 | 16531

Can you point me, where is the problem?

---

<div class="post-metadata">

**Author:** ![SkyTiger](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/skytiger/32/5476_2.png) [@SkyTiger](https://community.plotly.com/u/SkyTiger)\
**Post date:** [October 15, 2021, 12:29pm UTC](https://community.plotly.com/t/strange-behaviour-of-two-plots-on-one-graph/57599/2 "2021-10-15T12:29:45Z")

</div>

Ok, i got it.  
It’s all becouse i got str on xaxis\_col, not a number
