In [3]:
using PlotlyJS
In [22]:
function grouped_bar_example()
trace1 = bar(;x=["giraffes", "orangutans", "monkeys"],
y=[20, 14, 23],
name="SF Zoo")
trace2 = bar(;x=["giraffes", "orangutans", "monkeys"],
y=[12, 18, 29],
name="LA Zoo")
data = [trace1, trace2]
layout = Layout(;barmode="stack")
p = plot(data, layout)
# p.plot.layout[:barmode] = "stack"
end
function stacked_bar_example()
trace1 = bar(;x=["giraffes", "orangutans", "monkeys"],
y=[20, 14, 23],
name="SF Zoo")
trace2 = bar(x=["giraffes", "orangutans", "monkeys"],
y=[12, 18, 29],
name="LA Zoo")
data = [trace1, trace2]
layout = Layout(;barmode="stack")
plot(data, layout)
end
function bar_subplot()
p2 = stacked_bar_example()
p1 = grouped_bar_example()
p = [p1 p2]
p
end
# bar_subplot()
Out[22]:
In [11]:
In [ ]: