MCPcopy Create free account
hub / github.com/HxCa1/BEV-LIO-LC / named_plot

Function named_plot

include/matplotlibcpp.h:1291–1314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1289
1290template<typename Numeric>
1291bool named_plot(const std::string& name, const std::vector<Numeric>& y, const std::string& format = "")
1292{
1293 detail::_interpreter::get();
1294
1295 PyObject* kwargs = PyDict_New();
1296 PyDict_SetItemString(kwargs, "label", PyString_FromString(name.c_str()));
1297
1298 PyObject* yarray = detail::get_array(y);
1299
1300 PyObject* pystring = PyString_FromString(format.c_str());
1301
1302 PyObject* plot_args = PyTuple_New(2);
1303
1304 PyTuple_SetItem(plot_args, 0, yarray);
1305 PyTuple_SetItem(plot_args, 1, pystring);
1306
1307 PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_plot, plot_args, kwargs);
1308
1309 Py_DECREF(kwargs);
1310 Py_DECREF(plot_args);
1311 if (res) Py_DECREF(res);
1312
1313 return res;
1314}
1315
1316template<typename Numeric>
1317bool named_plot(const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = "")

Callers

nothing calls this directly

Calls 1

get_arrayFunction · 0.85

Tested by

no test coverage detected