JuliaLang/julia — Issue #295: want histograms
Author: alanedelman
Created: 2011-12-09 13:46:17+00:00
State: open

I'd like a hist function

Most languages, in addition to COUNT, give an option to have answers so that the area of the "bars"
equals 1.

Really I think COUNT and PDF=Normalized are the only two choices needed most, but some langauges
have other choices.

Here's a basic histc I once wrote in matlab notation:
I thought it was kind of clever but viral pointed out complexity not
being optimal:

function binsizes = myhistc(data, edges);
ne = length(edges); nd = length(data);
[ignore, p] = sort( [ edges data ] );
f = find(p <= ne); f = f(:)';
binsizes = diff([ f double(1 + nd + ne)]) - 1;

also i prefer line plots to bar plots especially for a pdf plot