matplotlib-cpp
matplotlib-cpp copied to clipboard
(Solved) MatplotlibDeprecationWarning: Passing non-integers as three-element position specification is deprecated since 3.3 and will be removed two minor releases later.
MSVC 2019 vanillia
Some argument are transmitted as "float" when they should be "long", This generate warning from python plot lib (as is mentioned in this issue subject)
Example "subplot"
inline void subplot(long nrows, long ncols, long plot_number)
{
detail::_interpreter::get();
// 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));
...
Work fine (and without warning from python plot) just doing replacement on the 3 above
PyFloat_FromDouble with PyLong_FromLong
This is alike what is already done in "subplot2grid". I suggest to consider this for "subplot" in main trunk. thanks