| 889 | |
| 890 | template<typename Numeric> |
| 891 | bool boxplot(const std::vector<std::vector<Numeric>>& data, |
| 892 | const std::vector<std::string>& labels = {}, |
| 893 | const std::map<std::string, std::string> & keywords = {}) |
| 894 | { |
| 895 | detail::_interpreter::get(); |
| 896 | |
| 897 | PyObject* listlist = detail::get_listlist(data); |
| 898 | PyObject* args = PyTuple_New(1); |
| 899 | PyTuple_SetItem(args, 0, listlist); |
| 900 | |
| 901 | PyObject* kwargs = PyDict_New(); |
| 902 | |
| 903 | // kwargs needs the labels, if there are (the correct number of) labels |
| 904 | if (!labels.empty() && labels.size() == data.size()) { |
| 905 | PyDict_SetItemString(kwargs, "labels", detail::get_array(labels)); |
| 906 | } |
| 907 | |
| 908 | // take care of the remaining keywords |
| 909 | for (const auto& it : keywords) |
| 910 | { |
| 911 | PyDict_SetItemString(kwargs, it.first.c_str(), PyString_FromString(it.second.c_str())); |
| 912 | } |
| 913 | |
| 914 | PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_boxplot, args, kwargs); |
| 915 | |
| 916 | Py_DECREF(args); |
| 917 | Py_DECREF(kwargs); |
| 918 | |
| 919 | if(res) Py_DECREF(res); |
| 920 | |
| 921 | return res; |
| 922 | } |
| 923 | |
| 924 | template<typename Numeric> |
| 925 | bool boxplot(const std::vector<Numeric>& data, |
nothing calls this directly
no test coverage detected