@@ -73,6 +73,7 @@ struct _interpreter {
73
73
PyObject *s_python_function_ylabel;
74
74
PyObject *s_python_function_xticks;
75
75
PyObject *s_python_function_yticks;
76
+ PyObject *s_python_function_tick_params;
76
77
PyObject *s_python_function_grid;
77
78
PyObject *s_python_function_clf;
78
79
PyObject *s_python_function_errorbar;
@@ -1370,6 +1371,30 @@ inline void yticks(const std::vector<Numeric> &ticks, const std::map<std::string
1370
1371
yticks (ticks, {}, keywords);
1371
1372
}
1372
1373
1374
+ inline void tick_params (const std::map<std::string, std::string>& keywords, const std::string axis = " both" )
1375
+ {
1376
+ // construct positional args
1377
+ PyObject* args;
1378
+ args = PyTuple_New (1 );
1379
+ PyTuple_SetItem (args, 0 , PyString_FromString (axis.c_str ()));
1380
+
1381
+ // construct keyword args
1382
+ PyObject* kwargs = PyDict_New ();
1383
+ for (std::map<std::string, std::string>::const_iterator it = keywords.begin (); it != keywords.end (); ++it)
1384
+ {
1385
+ PyDict_SetItemString (kwargs, it->first .c_str (), PyString_FromString (it->second .c_str ()));
1386
+ }
1387
+
1388
+
1389
+ PyObject* res = PyObject_Call (detail::_interpreter::get ().s_python_function_tick_params , args, kwargs);
1390
+
1391
+ Py_DECREF (args);
1392
+ Py_DECREF (kwargs);
1393
+ if (!res) throw std::runtime_error (" Call to tick_params() failed" );
1394
+
1395
+ Py_DECREF (res);
1396
+ }
1397
+
1373
1398
inline void subplot (long nrows, long ncols, long plot_number)
1374
1399
{
1375
1400
// construct positional args
0 commit comments