Hi guys I have some issues configuring my subplot of barcharts correctly, the documentation isnβt very helpful either.
My code:
from plotly.subplots import make_subplots
import plotly.graph_objects as go
from datatable import dt, f, by
df = dt.Frame(row=[1, 1, 2, 2, 1, 2], col=[3, 2, 2, 1, 1, 3])
subplot_bar = make_subplots(rows=2, cols=3, specs=[[{"type": "bar"}] * 3] * 2, subplot_titles=['a', 'b', 'c', 'd', 'e', 'f'])
for x in range(df.nrows):
dfplot = dt.Frame(a=['A', 'B', 'C', 'D'], b=[x + 1] * 4).to_pandas()
subplot_bar.add_trace(go.Bar(x=dfplot['a'], y=dfplot['b'], marker_color='rgb(99,110,251)'), row=df[x, 'row'], col=df[x, 'col'])
subplot_bar.update_layout(showlegend=False)
subplot_bar.show()
Outcome:
Issues:
- y-axis label
- y-axis max value should be the same for each plot
- change background color to white
Any suggestion are highly appreciated!