Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Why plotly go see my strings as integer?

I realized something with
As you see, on x axis there must be “x_variables” but some of them looks like integer and plotly go act like this. Why :confused:

import pandas as pd
import plotly.graph_objects as go
df=pd.DataFrame({"x_variables":['94508', 'a0780', 'b8360', '19c35', '80021', '77593'],

btrace1 = go.Bar(
btrace2 = go.Bar(
bdata = [btrace1, btrace2]
blayout = go.Layout(

barp = go.Figure(data=bdata, layout=blayout)

My graph is this. You can check with codes.

Now i realisez this:

  • If i update x axises like this

there is no problem an I can see my graph like I expected. But this is not the one I want. Because I have a live stream data and I have so much unique id (like in the x axis). And this type of things could not be good for dashboard.

If you have any other option, I wanna hear this.

Hi again,

I didnt solve this issue but I have new question.

I have other 10 variables. And I wanna see as hover info some of them.

My structure is same as top. And i use this for 1 variable info and it work well.


i add this to both of the traces. But when i tried this:


It is not working. I want some advice.

Regarding your initial question, if you upgrade to plotly version 4.14 the axis auto-detection code should do what you expect.

Regarding your other question, you can use, x="var", y="var", hover_data=["var", "var", "var"]) to do this more easily than having to build up your chart from go.Bar() objects.


Thanks for answer. But second answer didn’t work well. Because my graph is looks like top.

I have 2 traces, and i use them both with stack bar. I use for this go.Figure(data=data,layout=layout) data=[trace1,trace2] and both my traces are created with go.Bar.

So I’m trying to say, my structure “go” based. If i make one of them with “px” my structure boom.

If you have an advice. I want to hear this.