Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d184e14

Browse files
Patric SchmitzBenno Evers
Patric Schmitz
authored and
Benno Evers
committed
Add cumulative parameter to hist()
1 parent 05087cf commit d184e14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

matplotlibcpp.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,8 @@ bool fill_between(const std::vector<Numeric>& x, const std::vector<Numeric>& y1,
595595
}
596596

597597
template< typename Numeric>
598-
bool hist(const std::vector<Numeric>& y, long bins=10,std::string color="b", double alpha=1.0)
598+
bool hist(const std::vector<Numeric>& y, long bins=10,std::string color="b",
599+
double alpha=1.0, bool cumulative=false)
599600
{
600601

601602
PyObject* yarray = get_array(y);
@@ -604,6 +605,7 @@ bool hist(const std::vector<Numeric>& y, long bins=10,std::string color="b", dou
604605
PyDict_SetItemString(kwargs, "bins", PyLong_FromLong(bins));
605606
PyDict_SetItemString(kwargs, "color", PyString_FromString(color.c_str()));
606607
PyDict_SetItemString(kwargs, "alpha", PyFloat_FromDouble(alpha));
608+
PyDict_SetItemString(kwargs, "cumulative", cumulative ? Py_True : Py_False);
607609

608610
PyObject* plot_args = PyTuple_New(1);
609611

0 commit comments

Comments
 (0)