In [21]:
using DataFrames
using Distributions
using Gadfly
x = rand(Distributions.Normal(0, 1), 10000)
(edges, counts) = hist(x, 100)
xmin = edges[1 : (end - 1)]
xmax = edges[2 : end]
df = DataFrame(
xmin = xmin,
xmax = xmax,
x = (xmin + xmax) / 2,
density = counts / 1000.0 );
In [22]:
plot(df, x = :xmin, y = :density, Geom.bar)
Out[22]:
In [23]:
plot(df, xmin = :xmin, y = :density, Geom.bar)
Out[23]: