Closed
Description
Hello,
from plotly.graph_objs import Figure
from plotly import graph_objs as go
fig = Figure([go.Bar(x=[1, 2, 3], y=[3, 1, 2]),
go.Bar(x=[1, 2, 3], y=[0.3, 0.4, 0.1], width=[0.4, 0.6, 0.2])],
go.Layout(barmode='overlay',))
fig.show()
However if orientation='h'
is set the bars do not overlay.
EDIT: I forget to swap the x/y values, it works fine, I maybe did similar mistake when using plotly.express.timeline
.
fig = Figure([go.Bar(x=[3, 1, 2], y=[1, 2, 3], orientation='h'),
go.Bar(x=[0.3, 0.4, 0.1], y=[1, 2, 3], width=[0.4, 0.6, 0.2], orientation='h')],
go.Layout(barmode='overlay',))
fig.show()
$ python3 --version
Python 3.8.10
$ pip freeze | grep plotly
plotly==4.9.0
This is a serious complication for me because I was using plotly.express.timeline
and if I specify colors (which internally generates multiple go.Bar
instances) I can not have tasks on same row which is essential for my application (circuit scheduling visualization).
Metadata
Metadata
Assignees
Labels
No labels