From 88395d70fce27d60e58d03cf0483b5b112bc5d44 Mon Sep 17 00:00:00 2001 From: Eduardo Eller Behr Date: Tue, 27 Dec 2022 08:45:03 -0300 Subject: [PATCH 1/7] Fixed implicit conversion from long to double --- matplotlibcpp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index d95d46ad..b30b87f7 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -2255,9 +2255,9 @@ inline void subplot(long nrows, long ncols, long plot_number) // construct positional args PyObject* args = PyTuple_New(3); - PyTuple_SetItem(args, 0, PyFloat_FromDouble(nrows)); - PyTuple_SetItem(args, 1, PyFloat_FromDouble(ncols)); - PyTuple_SetItem(args, 2, PyFloat_FromDouble(plot_number)); + PyTuple_SetItem(args, 0, PyLong_FromLong(nrows)); + PyTuple_SetItem(args, 1, PyLong_FromLong(ncols)); + PyTuple_SetItem(args, 2, PyLong_FromLong(plot_number)); PyObject* res = PyObject_CallObject(detail::_interpreter::get().s_python_function_subplot, args); if(!res) throw std::runtime_error("Call to subplot() failed."); From e5478dc785cf9affb734a5d1929c6472b8e40e98 Mon Sep 17 00:00:00 2001 From: sugikazu75 Date: Mon, 26 Jan 2026 17:29:58 +0900 Subject: [PATCH 2/7] [fill_between] pass keywords with string and double separately in fill_between function --- matplotlibcpp.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index b30b87f7..e39223bd 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -819,7 +819,7 @@ bool fill(const std::vector& x, const std::vector& y, const st } template< typename Numeric > -bool fill_between(const std::vector& x, const std::vector& y1, const std::vector& y2, const std::map& keywords) +bool fill_between(const std::vector& x, const std::vector& y1, const std::vector& y2, const std::map& keywords_string = {}, const std::map keywords_double = {}) { assert(x.size() == y1.size()); assert(x.size() == y2.size()); @@ -839,9 +839,12 @@ bool fill_between(const std::vector& x, const std::vector& y1, // construct keyword args PyObject* kwargs = PyDict_New(); - for(std::map::const_iterator it = keywords.begin(); it != keywords.end(); ++it) { + for(std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) { PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); } + for(std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_fill_between, args, kwargs); From 588a9ae192a70d587368520c26940dc4e5a97903 Mon Sep 17 00:00:00 2001 From: sugikazu75 Date: Mon, 26 Jan 2026 19:11:30 +0900 Subject: [PATCH 3/7] [plot] enable to pass keywords with double key --- matplotlibcpp.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index e39223bd..91603b19 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -470,6 +470,43 @@ bool plot(const std::vector &x, const std::vector &y, const st return res; } +template +bool plot(const std::vector &x, const std::vector &y, const std::map& keywords_string, const std::map& keywords_double) +{ + assert(x.size() == y.size()); + + detail::_interpreter::get(); + + // using numpy arrays + PyObject* xarray = detail::get_array(x); + PyObject* yarray = detail::get_array(y); + + // construct positional args + PyObject* args = PyTuple_New(2); + PyTuple_SetItem(args, 0, xarray); + PyTuple_SetItem(args, 1, yarray); + + // construct keyword args + PyObject* kwargs = PyDict_New(); + for(std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) + { + PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); + } + for(std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) + { + PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + } + + PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_plot, args, kwargs); + + Py_DECREF(args); + Py_DECREF(kwargs); + if(res) Py_DECREF(res); + + return res; +} + + // TODO - it should be possible to make this work by implementing // a non-numpy alternative for `detail::get_2darray()`. #ifndef WITHOUT_NUMPY @@ -2884,6 +2921,11 @@ inline bool plot(const std::vector& x, const std::vector& y, con return plot(x,y,keywords); } +inline bool plot(const std::vector& x, const std::vector& y, const std::map& keywords_string, const std::map& keywords_double) +{ + return plot(x,y,keywords_string,keywords_double); +} + /* * This class allows dynamic plots, ie changing the plotted data without clearing and re-plotting */ From bf47920444da157a96ba8fef00f42920359044ec Mon Sep 17 00:00:00 2001 From: sugikazu75 Date: Mon, 26 Jan 2026 19:14:28 +0900 Subject: [PATCH 4/7] [legend] enable to pass keywords with double key --- matplotlibcpp.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 91603b19..40686ebe 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -2009,6 +2009,28 @@ inline void legend(const std::map& keywords) Py_DECREF(res); } +inline void legend(const std::map& keywords_string, const std::map& keywords_double) +{ + detail::_interpreter::get(); + + // construct keyword args + PyObject* kwargs = PyDict_New(); + for(std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) + { + PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); + } + for(std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) + { + PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + } + + PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_legend, detail::_interpreter::get().s_python_empty_tuple, kwargs); + if(!res) throw std::runtime_error("Call to legend() failed."); + + Py_DECREF(kwargs); + Py_DECREF(res); +} + template inline void set_aspect(Numeric ratio) { From 3b8ea7e706f68cf4883884382d0a4e342949ebd9 Mon Sep 17 00:00:00 2001 From: sugikazu75 Date: Mon, 26 Jan 2026 19:52:07 +0900 Subject: [PATCH 5/7] enable to pass double keywords in tick_params, title, xlabel, ylabel --- matplotlibcpp.h | 101 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 40686ebe..1ea25049 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -2311,6 +2311,35 @@ inline void tick_params(const std::map& keywords, cons Py_DECREF(res); } +inline void tick_params(const std::map& keywords_string, const std::map& keywords_double, const std::string axis = "both") +{ + detail::_interpreter::get(); + + // construct positional args + PyObject* args; + args = PyTuple_New(1); + PyTuple_SetItem(args, 0, PyString_FromString(axis.c_str())); + + // construct keyword args + PyObject* kwargs = PyDict_New(); + for (std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) + { + PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); + } + for (std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) + { + PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + } + + PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_tick_params, args, kwargs); + + Py_DECREF(args); + Py_DECREF(kwargs); + if (!res) throw std::runtime_error("Call to tick_params() failed"); + + Py_DECREF(res); +} + inline void subplot(long nrows, long ncols, long plot_number) { detail::_interpreter::get(); @@ -2376,6 +2405,30 @@ inline void title(const std::string &titlestr, const std::map &keywords_string, const std::map &keywords_double) +{ + detail::_interpreter::get(); + + PyObject* pytitlestr = PyString_FromString(titlestr.c_str()); + PyObject* args = PyTuple_New(1); + PyTuple_SetItem(args, 0, pytitlestr); + + PyObject* kwargs = PyDict_New(); + for (auto it = keywords_string.begin(); it != keywords_string.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); + } + for (auto it = keywords_double.begin(); it != keywords_double.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + } + + PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_title, args, kwargs); + if(!res) throw std::runtime_error("Call to title() failed."); + + Py_DECREF(args); + Py_DECREF(kwargs); + Py_DECREF(res); +} + inline void suptitle(const std::string &suptitlestr, const std::map &keywords = {}) { detail::_interpreter::get(); @@ -2511,6 +2564,30 @@ inline void xlabel(const std::string &str, const std::map &keywords_string, const std::map &keywords_double) +{ + detail::_interpreter::get(); + + PyObject* pystr = PyString_FromString(str.c_str()); + PyObject* args = PyTuple_New(1); + PyTuple_SetItem(args, 0, pystr); + + PyObject* kwargs = PyDict_New(); + for (auto it = keywords_string.begin(); it != keywords_string.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); + } + for (auto it = keywords_double.begin(); it != keywords_double.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + } + + PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_xlabel, args, kwargs); + if(!res) throw std::runtime_error("Call to xlabel() failed."); + + Py_DECREF(args); + Py_DECREF(kwargs); + Py_DECREF(res); +} + inline void ylabel(const std::string &str, const std::map& keywords = {}) { detail::_interpreter::get(); @@ -2532,6 +2609,30 @@ inline void ylabel(const std::string &str, const std::map& keywords_string, const std::map& keywords_double) +{ + detail::_interpreter::get(); + + PyObject* pystr = PyString_FromString(str.c_str()); + PyObject* args = PyTuple_New(1); + PyTuple_SetItem(args, 0, pystr); + + PyObject* kwargs = PyDict_New(); + for (auto it = keywords_string.begin(); it != keywords_string.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); + } + for (auto it = keywords_double.begin(); it != keywords_double.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + } + + PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_ylabel, args, kwargs); + if(!res) throw std::runtime_error("Call to ylabel() failed."); + + Py_DECREF(args); + Py_DECREF(kwargs); + Py_DECREF(res); +} + inline void set_zlabel(const std::string &str, const std::map& keywords = {}) { detail::_interpreter::get(); From 160e35bd4ff26687fdd6dd7b54c10716b79478e6 Mon Sep 17 00:00:00 2001 From: sugikazu75 Date: Sat, 31 Jan 2026 13:26:14 +0900 Subject: [PATCH 6/7] implement string to double parser and revert fixed functions --- matplotlibcpp.h | 218 ++++++++++-------------------------------------- 1 file changed, 46 insertions(+), 172 deletions(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 1ea25049..e6c2cb5d 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -435,43 +435,52 @@ PyObject* get_listlist(const std::vector>& ll) } // namespace detail -/// Plot a line through the given x and y data points.. -/// -/// See: https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.pyplot.plot.html -template -bool plot(const std::vector &x, const std::vector &y, const std::map& keywords) -{ - assert(x.size() == y.size()); - - detail::_interpreter::get(); +// helper function to parse keywords dictionary +static inline std::string trim_copy(const std::string& s) { + size_t a = 0, b = s.size(); + while (a < b && std::isspace(static_cast(s[a]))) ++a; + while (b > a && std::isspace(static_cast(s[b - 1]))) --b; + return s.substr(a, b - a); +} - // using numpy arrays - PyObject* xarray = detail::get_array(x); - PyObject* yarray = detail::get_array(y); +static inline PyObject* kw_to_pyobject(const std::string& value_in) { + std::string s = trim_copy(value_in); + if (s.empty()) return PyUnicode_FromString(""); - // construct positional args - PyObject* args = PyTuple_New(2); - PyTuple_SetItem(args, 0, xarray); - PyTuple_SetItem(args, 1, yarray); + // bool / None + if (s == "True" || s == "true") return PyBool_FromLong(1); + if (s == "False"|| s == "false") return PyBool_FromLong(0); + if (s == "None" || s == "none" || s == "null") { Py_RETURN_NONE; } - // construct keyword args - PyObject* kwargs = PyDict_New(); - for(std::map::const_iterator it = keywords.begin(); it != keywords.end(); ++it) - { - PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); + // int + { + char* end = nullptr; + errno = 0; + long long iv = std::strtoll(s.c_str(), &end, 10); + if (end && *end == '\0' && errno == 0) { + return PyLong_FromLong(iv); } + } - PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_plot, args, kwargs); - - Py_DECREF(args); - Py_DECREF(kwargs); - if(res) Py_DECREF(res); + // float + { + char* end = nullptr; + errno = 0; + double dv = std::strtod(s.c_str(), &end); + if (end && *end == '\0' && errno == 0) { + return PyFloat_FromDouble(dv); + } + } - return res; + // fallback: string + return PyUnicode_FromString(s.c_str()); } +/// Plot a line through the given x and y data points.. +/// +/// See: https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.pyplot.plot.html template -bool plot(const std::vector &x, const std::vector &y, const std::map& keywords_string, const std::map& keywords_double) +bool plot(const std::vector &x, const std::vector &y, const std::map& keywords) { assert(x.size() == y.size()); @@ -488,13 +497,9 @@ bool plot(const std::vector &x, const std::vector &y, const st // construct keyword args PyObject* kwargs = PyDict_New(); - for(std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) - { - PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); - } - for(std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) + for(std::map::const_iterator it = keywords.begin(); it != keywords.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + PyDict_SetItemString(kwargs, it->first.c_str(), kw_to_pyobject(it->second.c_str())); } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_plot, args, kwargs); @@ -856,7 +861,7 @@ bool fill(const std::vector& x, const std::vector& y, const st } template< typename Numeric > -bool fill_between(const std::vector& x, const std::vector& y1, const std::vector& y2, const std::map& keywords_string = {}, const std::map keywords_double = {}) +bool fill_between(const std::vector& x, const std::vector& y1, const std::vector& y2, const std::map& keywords) { assert(x.size() == y1.size()); assert(x.size() == y2.size()); @@ -876,11 +881,8 @@ bool fill_between(const std::vector& x, const std::vector& y1, // construct keyword args PyObject* kwargs = PyDict_New(); - for(std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); - } - for(std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + for(std::map::const_iterator it = keywords.begin(); it != keywords.end(); ++it) { + PyDict_SetItemString(kwargs, it->first.c_str(), kw_to_pyobject(it->second.c_str())); } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_fill_between, args, kwargs); @@ -1999,29 +2001,7 @@ inline void legend(const std::map& keywords) PyObject* kwargs = PyDict_New(); for(std::map::const_iterator it = keywords.begin(); it != keywords.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); - } - - PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_legend, detail::_interpreter::get().s_python_empty_tuple, kwargs); - if(!res) throw std::runtime_error("Call to legend() failed."); - - Py_DECREF(kwargs); - Py_DECREF(res); -} - -inline void legend(const std::map& keywords_string, const std::map& keywords_double) -{ - detail::_interpreter::get(); - - // construct keyword args - PyObject* kwargs = PyDict_New(); - for(std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) - { - PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); - } - for(std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) - { - PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + PyDict_SetItemString(kwargs, it->first.c_str(), kw_to_pyobject(it->second.c_str())); } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_legend, detail::_interpreter::get().s_python_empty_tuple, kwargs); @@ -2311,35 +2291,6 @@ inline void tick_params(const std::map& keywords, cons Py_DECREF(res); } -inline void tick_params(const std::map& keywords_string, const std::map& keywords_double, const std::string axis = "both") -{ - detail::_interpreter::get(); - - // construct positional args - PyObject* args; - args = PyTuple_New(1); - PyTuple_SetItem(args, 0, PyString_FromString(axis.c_str())); - - // construct keyword args - PyObject* kwargs = PyDict_New(); - for (std::map::const_iterator it = keywords_string.begin(); it != keywords_string.end(); ++it) - { - PyDict_SetItemString(kwargs, it->first.c_str(), PyString_FromString(it->second.c_str())); - } - for (std::map::const_iterator it = keywords_double.begin(); it != keywords_double.end(); ++it) - { - PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); - } - - PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_tick_params, args, kwargs); - - Py_DECREF(args); - Py_DECREF(kwargs); - if (!res) throw std::runtime_error("Call to tick_params() failed"); - - Py_DECREF(res); -} - inline void subplot(long nrows, long ncols, long plot_number) { detail::_interpreter::get(); @@ -2394,31 +2345,7 @@ inline void title(const std::string &titlestr, const std::mapfirst.c_str(), PyUnicode_FromString(it->second.c_str())); - } - - PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_title, args, kwargs); - if(!res) throw std::runtime_error("Call to title() failed."); - - Py_DECREF(args); - Py_DECREF(kwargs); - Py_DECREF(res); -} - -inline void title(const std::string &titlestr, const std::map &keywords_string, const std::map &keywords_double) -{ - detail::_interpreter::get(); - - PyObject* pytitlestr = PyString_FromString(titlestr.c_str()); - PyObject* args = PyTuple_New(1); - PyTuple_SetItem(args, 0, pytitlestr); - - PyObject* kwargs = PyDict_New(); - for (auto it = keywords_string.begin(); it != keywords_string.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); - } - for (auto it = keywords_double.begin(); it != keywords_double.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + PyDict_SetItemString(kwargs, it->first.c_str(), kw_to_pyobject(it->second.c_str())); } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_title, args, kwargs); @@ -2553,31 +2480,7 @@ inline void xlabel(const std::string &str, const std::mapfirst.c_str(), PyUnicode_FromString(it->second.c_str())); - } - - PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_xlabel, args, kwargs); - if(!res) throw std::runtime_error("Call to xlabel() failed."); - - Py_DECREF(args); - Py_DECREF(kwargs); - Py_DECREF(res); -} - -inline void xlabel(const std::string &str, const std::map &keywords_string, const std::map &keywords_double) -{ - detail::_interpreter::get(); - - PyObject* pystr = PyString_FromString(str.c_str()); - PyObject* args = PyTuple_New(1); - PyTuple_SetItem(args, 0, pystr); - - PyObject* kwargs = PyDict_New(); - for (auto it = keywords_string.begin(); it != keywords_string.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); - } - for (auto it = keywords_double.begin(); it != keywords_double.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + PyDict_SetItemString(kwargs, it->first.c_str(), kw_to_pyobject(it->second.c_str())); } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_xlabel, args, kwargs); @@ -2598,31 +2501,7 @@ inline void ylabel(const std::string &str, const std::mapfirst.c_str(), PyUnicode_FromString(it->second.c_str())); - } - - PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_ylabel, args, kwargs); - if(!res) throw std::runtime_error("Call to ylabel() failed."); - - Py_DECREF(args); - Py_DECREF(kwargs); - Py_DECREF(res); -} - -inline void ylabel(const std::string &str, const std::map& keywords_string, const std::map& keywords_double) -{ - detail::_interpreter::get(); - - PyObject* pystr = PyString_FromString(str.c_str()); - PyObject* args = PyTuple_New(1); - PyTuple_SetItem(args, 0, pystr); - - PyObject* kwargs = PyDict_New(); - for (auto it = keywords_string.begin(); it != keywords_string.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyUnicode_FromString(it->second.c_str())); - } - for (auto it = keywords_double.begin(); it != keywords_double.end(); ++it) { - PyDict_SetItemString(kwargs, it->first.c_str(), PyFloat_FromDouble(it->second)); + PyDict_SetItemString(kwargs, it->first.c_str(), kw_to_pyobject(it->second.c_str())); } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_ylabel, args, kwargs); @@ -3044,11 +2923,6 @@ inline bool plot(const std::vector& x, const std::vector& y, con return plot(x,y,keywords); } -inline bool plot(const std::vector& x, const std::vector& y, const std::map& keywords_string, const std::map& keywords_double) -{ - return plot(x,y,keywords_string,keywords_double); -} - /* * This class allows dynamic plots, ie changing the plotted data without clearing and re-plotting */ From fedf111aafaba2c3238eca2d9c8431ab34ff8016 Mon Sep 17 00:00:00 2001 From: sugikazu75 Date: Sat, 31 Jan 2026 13:28:21 +0900 Subject: [PATCH 7/7] remove unnecessary break line --- matplotlibcpp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index e6c2cb5d..dc6100fe 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -511,7 +511,6 @@ bool plot(const std::vector &x, const std::vector &y, const st return res; } - // TODO - it should be possible to make this work by implementing // a non-numpy alternative for `detail::get_2darray()`. #ifndef WITHOUT_NUMPY