Permalink
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (47 sloc) 1.1 KB

Plotting

Pkg.add("StatPlots")
Pkg.add("GR")
using StatPlots
ENV["GKSwstype"] = "100"
gr()
srand(1234)  # set random seed to get consistent plots

StatPlots

JuliaDB has all access to all the power and flexibility of Plots via StatPlots and the @df macro.

using JuliaDB, StatPlots

t = table(@NT(x = randn(100), y = randn(100)))

@df t scatter(:x, :y)
savefig("statplot.png"); nothing # hide

partitionplot

partitionplot

Examples

using JuliaDB, Plots, OnlineStats

x = randn(10^6)
y = x + randn(10^6)
z = x .> 0
t = table(@NT(x=x, y=y, z=z))

# x by itself
partitionplot(t, :x, stat = Extrema())
savefig("plot1.png"); nothing # hide

# y by x
partitionplot(t, :x, :y, stat = Hist(25))
savefig("plot2.png"); nothing # hide

# y by x, grouped by z
partitionplot(t, :x, :y, stat = Extrema(), by = z)
savefig("plot3.png"); nothing # hide