cat_list = ["rain", "snow", "thunder"]
fig = go.Figure()
for idx, cat in enumerate(cat_list):
fig.add_trace(
go.Scatter(
x=cat_timestamp_list,
# this will add one dot per item in cat_timestamp_list
# the dots will be along the y=idx+1 line
y=[idx+1 for i in cat_timestamp_list],
mode="markers"
)
)
# format yticks to match cat names
fig.update_layout(
yaxis = dict(
tickmode = 'array',
tickvals = [idx + 1 for idx in range(cat_list)],
ticktext = cat_list
)
)
You would have to format the date in xaxis as well, but this is well covered in the documentation. I am not sure if there is a simpler solution with express, it could be.
Is there any way to create more than 2 levels of axis category? From the offical doc, I see there is only 2 levels of axis categories allown to be created while my case is users asking for multiple (larger than 2) levels of axis category.