MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / fewerbins

Method fewerbins

source/matplot/axes_objects/histogram.cpp:833–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831 }
832
833 size_t histogram::fewerbins(double bin_decrease) {
834 size_t old_size = this->num_bins();
835 size_t new_size = static_cast<size_t>(
836 ceil(static_cast<double>(this->num_bins()) * (1. - bin_decrease)));
837 new_size -= new_size == old_size;
838 new_size = std::max(new_size, size_t(1));
839 this->num_bins(new_size);
840 return this->num_bins();
841 }
842
843} // namespace matplot

Callers 1

fewerbinsFunction · 0.80

Calls 2

num_binsMethod · 0.95
maxFunction · 0.50

Tested by

no test coverage detected