using PlotlyJS
23 PlotlyJS
Basic plots using Plotly.jl.
23.1 Boxplot
= randn(300);
x = randn(400) .+ 1.6;
y = randn(320) .- 2.2; z
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
= kde(x)
xd 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
= randn(300);
x = 3 .+ x.^3 + randn(300);
y = 4 .+ x.^2 + randn(300); y2
Plot(scatter(x=x, y=y, mode="markers"))
Plot([scatter(x=x, y=v, mode="markers") for v in [y, y2]])
23.5 Barplot
= ["alpha", "beta", "gamma"];
x = [3, 9, 5];
y = [5, 8, 7]; y2
Plot(bar(x=x, y=y))
Plot([bar(x=x, y=v) for v in [y, y2]])
# bar(x, [y, y2], bar_position=:stack)