How to create plot with duplicate xaxis labels and 2 xaxis in the same plot?

Thanks for posting in the community forum!

You might find the discussion in Multicategory Axis Type Example? to be helpful, as it addresses a very similar issue to the one you are having.

To get you started creating your plot, here is some example code I came up with:

import plotly.graph_objects as go
x = [
    ["usa", "usa", "usa", "usa", "usa", 
     "africa", "africa", "africa", "africa", "africa", "africa", 
     "china", "china", "china", "china", "china"],
    ["abc", "xyz", "pqr", "mno", "fgh", 
     "xyz", "opo", "kjh", "pqr", "bcc", 
     "pqr", "tyu", "opo", "xyz", "ghj"]
]
fig = go.Figure()
fig.add_bar(x=x,y=[18, 10, 4, 4, 4, 14, 0, 0, 0, 0, 10, 4, 4, 0, 0])
fig.show()

2 Likes