@@ -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;
@@ -203,6 +204,7 @@ struct _interpreter {
203
204
s_python_function_ylabel = safe_import (pymod, " ylabel" );
204
205
s_python_function_xticks = safe_import (pymod, " xticks" );
205
206
s_python_function_yticks = safe_import (pymod, " yticks" );
207
+ s_python_function_tick_params = safe_import (pymod, " tick_params" );
206
208
s_python_function_grid = safe_import (pymod, " grid" );
207
209
s_python_function_xlim = safe_import (pymod, " xlim" );
208
210
s_python_function_ion = safe_import (pymod, " ion" );
@@ -1375,6 +1377,30 @@ inline void yticks(const std::vector<Numeric> &ticks, const std::map<std::string
1375
1377
yticks (ticks, {}, keywords);
1376
1378
}
1377
1379
1380
+ inline void tick_params (const std::map<std::string, std::string>& keywords, const std::string axis = " both" )
1381
+ {
1382
+ // construct positional args
1383
+ PyObject* args;
1384
+ args = PyTuple_New (1 );
1385
+ PyTuple_SetItem (args, 0 , PyString_FromString (axis.c_str ()));
1386
+
1387
+ // construct keyword args
1388
+ PyObject* kwargs = PyDict_New ();
1389
+ for (std::map<std::string, std::string>::const_iterator it = keywords.begin (); it != keywords.end (); ++it)
1390
+ {
1391
+ PyDict_SetItemString (kwargs, it->first .c_str (), PyString_FromString (it->second .c_str ()));
1392
+ }
1393
+
1394
+
1395
+ PyObject* res = PyObject_Call (detail::_interpreter::get ().s_python_function_tick_params , args, kwargs);
1396
+
1397
+ Py_DECREF (args);
1398
+ Py_DECREF (kwargs);
1399
+ if (!res) throw std::runtime_error (" Call to tick_params() failed" );
1400
+
1401
+ Py_DECREF (res);
1402
+ }
1403
+
1378
1404
inline void subplot (long nrows, long ncols, long plot_number)
1379
1405
{
1380
1406
// construct positional args
0 commit comments