@@ -1174,6 +1174,9 @@ bool errorbar(const std::vector<NumericX> &x, const std::vector<NumericY> &y, co
1174
1174
template <typename Numeric>
1175
1175
bool named_plot (const std::string& name, const std::vector<Numeric>& y, const std::string& format = " " )
1176
1176
{
1177
+ // Make sure python is initialized.
1178
+ detail::_interpreter::get ();
1179
+
1177
1180
PyObject* kwargs = PyDict_New ();
1178
1181
PyDict_SetItemString (kwargs, " label" , PyString_FromString (name.c_str ()));
1179
1182
@@ -1198,6 +1201,9 @@ bool named_plot(const std::string& name, const std::vector<Numeric>& y, const st
1198
1201
template <typename Numeric>
1199
1202
bool named_plot (const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = " " )
1200
1203
{
1204
+ // Make sure python is initialized.
1205
+ detail::_interpreter::get ();
1206
+
1201
1207
PyObject* kwargs = PyDict_New ();
1202
1208
PyDict_SetItemString (kwargs, " label" , PyString_FromString (name.c_str ()));
1203
1209
@@ -1223,6 +1229,9 @@ bool named_plot(const std::string& name, const std::vector<Numeric>& x, const st
1223
1229
template <typename Numeric>
1224
1230
bool named_semilogx (const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = " " )
1225
1231
{
1232
+ // Make sure python is initialized.
1233
+ detail::_interpreter::get ();
1234
+
1226
1235
PyObject* kwargs = PyDict_New ();
1227
1236
PyDict_SetItemString (kwargs, " label" , PyString_FromString (name.c_str ()));
1228
1237
@@ -1248,6 +1257,9 @@ bool named_semilogx(const std::string& name, const std::vector<Numeric>& x, cons
1248
1257
template <typename Numeric>
1249
1258
bool named_semilogy (const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = " " )
1250
1259
{
1260
+ // Make sure python is initialized.
1261
+ detail::_interpreter::get ();
1262
+
1251
1263
PyObject* kwargs = PyDict_New ();
1252
1264
PyDict_SetItemString (kwargs, " label" , PyString_FromString (name.c_str ()));
1253
1265
@@ -1273,6 +1285,9 @@ bool named_semilogy(const std::string& name, const std::vector<Numeric>& x, cons
1273
1285
template <typename Numeric>
1274
1286
bool named_loglog (const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = " " )
1275
1287
{
1288
+ // Make sure python is initialized.
1289
+ detail::_interpreter::get ();
1290
+
1276
1291
PyObject* kwargs = PyDict_New ();
1277
1292
PyDict_SetItemString (kwargs, " label" , PyString_FromString (name.c_str ()));
1278
1293
0 commit comments