Skip to content

Commit d184e14

Browse files
Patric SchmitzBenno Evers
authored andcommitted
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy