Hi all!
I’m new writing in the forum, not reading, thank you all for sharing your knowledge. I’ve joined to ask if there is any possibility to use multicartegory in the y-axis. Or maybe there are plans to make this possible in near future? It would be very interesting,
If you can describe what you are trying to achieve that would help others answer your question. What type of chart are you working with? Any screenshots or code snippets is highly encouraged.
Also have you checked this section of the docs, this might be what you are looking for - Categorical axes in Python
Hi @atharvakatre , thank you four your response. Sure, I should have gave those details in my question! I’ve read that documentation and I’ve already used it in some charts like this:
Now I also need it to do something like:
You can use multicategory for both x and y-axis, however for y-axis you may have to change the orientation of the bars to be horizontal. See the use of orientation='h' in the below example:
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Bar(
x = [2, 3, 1, 5],
y = [['First', 'First', 'Second', 'Second'],
["A", "B", "A", "B"]],
name = "Adults",
orientation='h'
))
fig.add_trace(go.Bar(
x = [8, 3, 6, 5],
y = [['First', 'First', 'Second', 'Second'],
["A", "B", "A", "B"]],
name = "Children",
orientation='h'
))
fig.update_layout(title_text="Multi-category axis")
fig.show()