• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015-2018 Hans Dembinski
2 //
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
6 
7 //[ guide_axis_with_uoflow_off
8 
9 #include <boost/histogram.hpp>
10 #include <string>
11 
main()12 int main() {
13   using namespace boost::histogram;
14 
15   // create a 1d-histogram over integer values from 1 to 6
16   auto h1 = make_histogram(axis::integer<int>(1, 7));
17   // axis has size 6...
18   assert(h1.axis().size() == 6);
19   // ... but histogram has size 8, because of overflow and underflow bins
20   assert(h1.size() == 8);
21 
22   // create a 1d-histogram for throws of a six-sided die without extra bins,
23   // since the values cannot be smaller than 1 or larger than 6
24   auto h2 = make_histogram(axis::integer<int, use_default, axis::option::none_t>(1, 7));
25   // now size of axis and histogram is equal
26   assert(h2.axis().size() == 6);
27   assert(h2.size() == 6);
28 }
29 
30 //]
31