It seems from the documentation that
my $h = gsl_histogram_alloc 3;
gsl_histogram_set_ranges $h, [0, 41, 61, 100], 4;
gsl_histogram_increment $h, $_ for @values;
will do what you like, whereupon the histogram can be printed using
gsl_histogram_fprintf or
gsl_histogram_fscanf. (I don't understand why
gsl_histogram_set_ranges needs that final argument, since it can be figured automatically once
$h is known; but the documentation says it does, and I am not in a position to test.)
(Boy, gotta love those flat namespaces. I'll bet it's fun to call these functions as Math::GSL::Histogram::gsl_histogram_xxx.)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.