From b8b0c066a22581f03c019eef007c029183043627 Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Sun, 28 Apr 2024 16:53:27 +0800 Subject: [PATCH] fix: bug for 'Call to subplot() failed.' --- src/rl_sar/library/matplotlibcpp/matplotlibcpp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rl_sar/library/matplotlibcpp/matplotlibcpp.h b/src/rl_sar/library/matplotlibcpp/matplotlibcpp.h index d95d46a..8acf816 100644 --- a/src/rl_sar/library/matplotlibcpp/matplotlibcpp.h +++ b/src/rl_sar/library/matplotlibcpp/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_FromDouble(nrows)); + PyTuple_SetItem(args, 1, PyLong_FromDouble(ncols)); + PyTuple_SetItem(args, 2, PyLong_FromDouble(plot_number)); PyObject* res = PyObject_CallObject(detail::_interpreter::get().s_python_function_subplot, args); if(!res) throw std::runtime_error("Call to subplot() failed.");