@@ -446,7 +446,8 @@ namespace detail {
446
446
// @param s The formatting string for colour, marker and linestyle
447
447
// @param keywords Additional keywords, such as label
448
448
// @return true if plot was successful, false otherwise
449
- template <typename VectorX, typename VectorY>
449
+ template <typename VectorX = std::vector<double >,
450
+ typename VectorY = std::vector<double >>
450
451
bool plot_base (PyObject *const pyfunc, const VectorX &x, const VectorY &y,
451
452
const std::string &s = " " ,
452
453
const std::map<std::string, std::string> &keywords = {}) {
@@ -493,7 +494,7 @@ bool plot(const VectorX &x, const VectorY &y,
493
494
return plot (x, y, " " , keywords);
494
495
}
495
496
496
- template <typename VectorY>
497
+ template <typename VectorY = std::vector< double > >
497
498
bool plot (const VectorY &y, const std::string &format = " " ,
498
499
const std::map<std::string, std::string> &keywords = {}) {
499
500
// TODO can this be <size_t> or do we need <typename Vector::value_type>?
@@ -506,7 +507,7 @@ bool plot(const VectorY &y, const std::string &format = "",
506
507
return plot (x, y, format);
507
508
}
508
509
509
- template <typename VectorY>
510
+ template <typename VectorY = std::vector< double > >
510
511
bool plot (const VectorY &y,
511
512
const std::map<std::string, std::string> &keywords) {
512
513
std::vector<std::size_t > x (y.size ());
@@ -529,7 +530,7 @@ bool loglog(const VectorX &x, const VectorY &y,
529
530
return loglog (x, y, " " , keywords);
530
531
}
531
532
532
- template <typename VectorY>
533
+ template <typename VectorY = std::vector< double > >
533
534
bool loglog (const VectorY &y, const std::string &s = " " ,
534
535
const std::map<std::string, std::string> &keywords = {}) {
535
536
std::vector<std::size_t > x (y.size ());
@@ -539,7 +540,7 @@ bool loglog(const VectorY &y, const std::string &s = "",
539
540
return loglog (x, y, s, keywords);
540
541
}
541
542
542
- template <typename VectorY>
543
+ template <typename VectorY = std::vector< double > >
543
544
bool loglog (const VectorY &y,
544
545
const std::map<std::string, std::string> &keywords) {
545
546
std::vector<std::size_t > x (y.size ());
@@ -1250,8 +1251,8 @@ inline double *ylim() {
1250
1251
PyObject *args = PyTuple_New (0 );
1251
1252
PyObject *res = PyObject_CallObject (
1252
1253
detail::_interpreter::get ().s_python_function_ylim , args);
1253
- PyObject *left = PyTuple_GetItem (res, 0 );
1254
- PyObject *right = PyTuple_GetItem (res, 1 );
1254
+ PyObject *bottom = PyTuple_GetItem (res, 0 );
1255
+ PyObject *top = PyTuple_GetItem (res, 1 );
1255
1256
1256
1257
double *arr = new double [2 ];
1257
1258
arr[0 ] = PyFloat_AsDouble (bottom);
@@ -1663,6 +1664,7 @@ inline void tight_layout() {
1663
1664
Py_DECREF (res);
1664
1665
}
1665
1666
1667
+ #if 0
1666
1668
// recursion stop for the below
1667
1669
template <typename... Args> bool plot() { return true; }
1668
1670
@@ -1688,6 +1690,7 @@ inline bool plot(const std::vector<double> &x, const std::vector<double> &y,
1688
1690
const std::map<std::string, std::string> &keywords) {
1689
1691
return plot<std::vector<double>, std::vector<double>>(x, y, keywords);
1690
1692
}
1693
+ #endif
1691
1694
1692
1695
/*
1693
1696
* This class allows dynamic plots, ie changing the plotted data without
0 commit comments