From 6a47f301b4713201d564b9d82cb1acd52e37cb4c Mon Sep 17 00:00:00 2001 From: Marlucio Barbosa Date: Tue, 8 Dec 2020 10:25:19 -0300 Subject: [PATCH 1/4] Inclusion of the figure number in the figure_size method. --- matplotlibcpp.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 93a72be5..8c683c81 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -1587,7 +1587,7 @@ inline bool fignum_exists(long number) return ret; } -inline void figure_size(size_t w, size_t h) +inline void figure_size(size_t w, size_t h, long number = -1) { detail::_interpreter::get(); @@ -1600,6 +1600,10 @@ inline void figure_size(size_t w, size_t h) PyDict_SetItemString(kwargs, "figsize", size); PyDict_SetItemString(kwargs, "dpi", PyLong_FromSize_t(dpi)); + if (number == -1){ + PyDict_SetItemString(kwargs, "num", number); + } + PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_figure, detail::_interpreter::get().s_python_empty_tuple, kwargs); From d6ff36de4e54dda6e7322a46f6ce6b2f7dab2442 Mon Sep 17 00:00:00 2001 From: Marlucio Barbosa Date: Tue, 8 Dec 2020 10:30:33 -0300 Subject: [PATCH 2/4] Inclusion of the figure number in the figure_size method. --- matplotlibcpp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 8c683c81..ec86cecc 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -1601,7 +1601,7 @@ inline void figure_size(size_t w, size_t h, long number = -1) PyDict_SetItemString(kwargs, "dpi", PyLong_FromSize_t(dpi)); if (number == -1){ - PyDict_SetItemString(kwargs, "num", number); + PyDict_SetItemString(kwargs, "num", PyLong_FromLong(number)); } PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_figure, From 17ea3233596d26649e3d4cd07d67382dd40b0325 Mon Sep 17 00:00:00 2001 From: Marlucio Barbosa Date: Tue, 8 Dec 2020 10:40:07 -0300 Subject: [PATCH 3/4] Inclusion of the figure number in the figure_size method. --- matplotlibcpp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index ec86cecc..434c2efd 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -1600,7 +1600,7 @@ inline void figure_size(size_t w, size_t h, long number = -1) PyDict_SetItemString(kwargs, "figsize", size); PyDict_SetItemString(kwargs, "dpi", PyLong_FromSize_t(dpi)); - if (number == -1){ + if (number > -1){ PyDict_SetItemString(kwargs, "num", PyLong_FromLong(number)); } From 169076da3685b5d0d704ae5a85268e919c74fc09 Mon Sep 17 00:00:00 2001 From: Marlucio Barbosa Date: Tue, 8 Dec 2020 11:39:59 -0300 Subject: [PATCH 4/4] rollback --- matplotlibcpp.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index 434c2efd..93a72be5 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -1587,7 +1587,7 @@ inline bool fignum_exists(long number) return ret; } -inline void figure_size(size_t w, size_t h, long number = -1) +inline void figure_size(size_t w, size_t h) { detail::_interpreter::get(); @@ -1600,10 +1600,6 @@ inline void figure_size(size_t w, size_t h, long number = -1) PyDict_SetItemString(kwargs, "figsize", size); PyDict_SetItemString(kwargs, "dpi", PyLong_FromSize_t(dpi)); - if (number > -1){ - PyDict_SetItemString(kwargs, "num", PyLong_FromLong(number)); - } - PyObject* res = PyObject_Call(detail::_interpreter::get().s_python_function_figure, detail::_interpreter::get().s_python_empty_tuple, kwargs);