matplotlib-cpp icon indicating copy to clipboard operation
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.

Open GordonEldest opened this issue 4 years ago • 0 comments

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

GordonEldest avatar Oct 13 '21 14:10 GordonEldest