@@ -44,6 +44,7 @@ namespace matplotlibcpp {
44
44
PyObject *s_python_function_subplot;
45
45
PyObject *s_python_function_legend;
46
46
PyObject *s_python_function_xlim;
47
+ PyObject *s_python_function_ion;
47
48
PyObject *s_python_function_ylim;
48
49
PyObject *s_python_function_title;
49
50
PyObject *s_python_function_axis;
@@ -130,6 +131,7 @@ namespace matplotlibcpp {
130
131
s_python_function_ylabel = PyObject_GetAttrString (pymod, " ylabel" );
131
132
s_python_function_grid = PyObject_GetAttrString (pymod, " grid" );
132
133
s_python_function_xlim = PyObject_GetAttrString (pymod, " xlim" );
134
+ s_python_function_ion = PyObject_GetAttrString (pymod, " ion" );
133
135
s_python_function_save = PyObject_GetAttrString (pylabmod, " savefig" );
134
136
s_python_function_annotate = PyObject_GetAttrString (pymod," annotate" );
135
137
s_python_function_clf = PyObject_GetAttrString (pymod, " clf" );
@@ -156,6 +158,7 @@ namespace matplotlibcpp {
156
158
|| !s_python_function_ylabel
157
159
|| !s_python_function_grid
158
160
|| !s_python_function_xlim
161
+ || !s_python_function_ion
159
162
|| !s_python_function_save
160
163
|| !s_python_function_clf
161
164
|| !s_python_function_annotate
@@ -185,6 +188,7 @@ namespace matplotlibcpp {
185
188
|| !PyFunction_Check (s_python_function_ylabel)
186
189
|| !PyFunction_Check (s_python_function_grid)
187
190
|| !PyFunction_Check (s_python_function_xlim)
191
+ || !PyFunction_Check (s_python_function_ion)
188
192
|| !PyFunction_Check (s_python_function_save)
189
193
|| !PyFunction_Check (s_python_function_clf)
190
194
|| !PyFunction_Check (s_python_function_tight_layout)
@@ -961,6 +965,16 @@ namespace matplotlibcpp {
961
965
Py_DECREF (res);
962
966
}
963
967
968
+ inline void ion () {
969
+ PyObject *res = PyObject_CallObject (
970
+ detail::_interpreter::get ().s_python_function_ion ,
971
+ detail::_interpreter::get ().s_python_empty_tuple );
972
+
973
+ if (!res) throw std::runtime_error (" Call to ion() failed." );
974
+
975
+ Py_DECREF (res);
976
+ }
977
+
964
978
// Actually, is there any reason not to call this automatically for every plot?
965
979
inline void tight_layout () {
966
980
PyObject *res = PyObject_CallObject (
0 commit comments