8000 Add cumulative parameter to hist() · samox73/matplotlib-cpp@d184e14 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Lines changed: 3 additions & 1 deletion
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)
0