Files
histogram/examples/example_2d.cpp

17 lines
487 B
C++

#include <boost/histogram.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/normal_distribution.hpp>
int main() {
using namespace boost;
random::mt19937 gen;
random::normal_distribution<> norm;
auto h = histogram::make_static_histogram(
histogram::axis::regular<>(100, -5, 5, "x"),
histogram::axis::regular<>(100, -5, 5, "y")
);
for (int i = 0; i < 1000; ++i)
h.fill(norm(gen), norm(gen));
// h is now filled
}