8000 fix wrong argument names · yalcin09/matplotlib-cpp@993fed1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 993fed1

Browse files
committed
fix wrong argument names
1 parent d3b7f32 commit 993fed1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

matplotlibcpp.h

Lines changed: 8 additions & 8 deletions
1260
Original file line numberDiff line numberDiff line change
@@ -1186,12 +1186,12 @@ inline void legend(const std::string &loc = "best",
11861186
Py_DECREF(res);
11871187
}
11881188

1189-
template <typename Numeric> void ylim(Numeric left, Numeric right) {
1189+
template <typename Numeric> void ylim(Numeric bottom, Numeric top) {
11901190
detail::_interpreter::get();
11911191

11921192
PyObject *list = PyList_New(2);
1193-
PyList_SetItem(list, 0, PyFloat_FromDouble(left));
1194-
PyList_SetItem(list, 1, PyFloat_FromDouble(right));
1193+
PyList_SetItem(list, 0, PyFloat_FromDouble(bottom));
1194+
PyList_SetItem(list, 1, PyFloat_FromDouble(top));
11951195

11961196
PyObject *args = PyTuple_New(1);
11971197
PyTuple_SetItem(args, 0, list);
@@ -1254,8 +1254,8 @@ inline double *ylim() {
12541254
PyObject *right = PyTuple_GetItem(res, 1);
12551255

12561256
double *arr = new double[2];
1257-
arr[0] = PyFloat_AsDouble(left);
1258-
arr[1] = PyFloat_AsDouble(right);
1257+
arr[0] = PyFloat_AsDouble(bottom);
1258+
arr[1] = PyFloat_AsDouble(top);
12591259

1260
if (!res)
12611261
throw std::runtime_error("Call to ylim() failed.");
@@ -1432,15 +1432,15 @@ inline void suptitle(const std::string &suptitlestr,
14321432
Py_DECREF(res);
14331433
}
14341434

1435-
inline void axis(const std::string &axisstr) {
1436-
PyObject *str = PyString_FromString(axisstr.c_str());
1435+
inline void axis(const std::string &option) {
1436+
PyObject *str = PyString_FromString(option.c_str());
14371437
PyObject *args = PyTuple_New(1);
14381438
PyTuple_SetItem(args, 0, str);
14391439

14401440
PyObject *res = PyObject_CallObject(
14411441
detail::_interpreter::get().s_python_function_axis, args);
14421442
if (!res)
1443-
throw std::runtime_error("Call to title() failed.");
1443+
throw std::runtime_error("Call to axis() failed.");
14441444

14451445
Py_DECREF(args);
14461446
Py_DECREF(res);

0 commit comments

Comments
 (0)
0