MCPcopy Create free account
hub / github.com/HViktorTsoi/FAST_LIO_LOCALIZATION / annotate

Function annotate

include/matplotlibcpp.h:270–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270inline bool annotate(std::string annotation, double x, double y)
271{
272 detail::_interpreter::get();
273
274 PyObject * xy = PyTuple_New(2);
275 PyObject * str = PyString_FromString(annotation.c_str());
276
277 PyTuple_SetItem(xy,0,PyFloat_FromDouble(x));
278 PyTuple_SetItem(xy,1,PyFloat_FromDouble(y));
279
280 PyObject* kwargs = PyDict_New();
281 PyDict_SetItemString(kwargs, "xy", xy);
282
283 PyObject* args = PyTuple_New(1);
284 PyTuple_SetItem(args, 0, str);
285
286 PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_annotate, args, kwargs);
287
288 Py_DECREF(args);
289 Py_DECREF(kwargs);
290
291 if(res) Py_DECREF(res);
292
293 return res;
294}
295
296namespace detail {
297

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected