23  PlotlyJS

using PlotlyJS

Basic plots using Plotly.jl.

23.1 Boxplot

x = randn(300);
y = randn(400) .+ 1.6;
z = randn(320) .- 2.2;
Plot(box(y=x))
Plot(box(y=x, boxpoints="all"))
Plot([box(y=v) for v in [x, y, z]])

23.2 Density

import KernelDensity: kde
xd = kde(x)
Plot(scatter(x=xd.x, y = xd.density, mode="lines", fill="tozeroy"))

23.3 Histogram

Plot(histogram(x=x))
Plot([histogram(x = v) for v in [x, y, z]])

23.4 Scatter

x = randn(300);
y = 3 .+ x.^3 + randn(300);
y2 = 4 .+ x.^2 + randn(300);
Plot(scatter(x=x, y=y, mode="markers"))
Plot([scatter(x=x, y=v, mode="markers") for v in [y, y2]])

23.5 Barplot

x = ["alpha", "beta", "gamma"];
y = [3, 9, 5];
y2 = [5, 8, 7];
Plot(bar(x=x, y=y))
Plot([bar(x=x, y=v) for v in [y, y2]])
# bar(x, [y, y2], bar_position=:stack)

23.6 Resources