title: hexbin author: Daniel Jones part: Geometry order: 1013 ...
Bin data into tiled hexagonal bins and color by count.
x
: Observations to be binned and plotted on the x-axis.y
: Observations to be binned and plotted on the y-axis.xsize
ysize
By default Stat.hexbin
is applied which bins x
and y
observations and
colors hexagons according to count. To override this, pass Stat.identity
to
plot
and manually bind the color
aesthetic.
xbincount
: Number of bins along the x-axis.ybincount
: Number of bins along the y-axis.
using Gadfly, Distributions
Gadfly.prepare_display()
Gadfly.set_default_plot_size(14cm, 8cm)
X = rand(MultivariateNormal([0.0, 0.0], [1.0 0.5; 0.5 1.0]), 10000)
plot(x=X[1,:], y=X[2,:], Geom.hexbin)
plot(x=X[1,:], y=X[2,:], Geom.hexbin(xbincount=100, ybincount=100))