Bar and histograms


In [3]:
using PlotlyJS


Plotly javascript loaded.

To load again call

init_notebook(true)


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()


WARNING: Method definition grouped_bar_example() in module Main at In[21]:2 overwritten at In[22]:2.
WARNING: Method definition stacked_bar_example() in module Main at In[19]:15 overwritten at In[22]:15.
WARNING: Method definition bar_subplot() in module Main at In[19]:27 overwritten at In[22]:27.
Out[22]:

In [11]:



MethodError: no method matching getindex(::PlotlyJS.SyncPlot{PlotlyJS.JupyterDisplay}, ::Int64)

In [ ]: