Skip to content

Crash when I try to open multiple plot windows #2

@ThisIsACreativeName

Description

@ThisIsACreativeName

First of all, I really enjoy using your matplotlib-cpp wrapper thingy. So thank you for your effort.

I try to show multiple plots in different windows simultaneously. But as soon as I show() a second plot the application crashes.
A colleague of mine said it could be connected to the blocking behavior of the show function (as far as I understood blocking usally means the execution is stopped till the plot window is closed. Maybe this is the case for python, but my C++ code keeps running, so maybe there's the conflict?).
When I close the window first and then open another or the same plot again via show() everything is fine.

I tried to manipulate the code in the header file a bit to pass an optional argument (and I think optional is the critical point) containing ...
block=False
... to the original python matplotlib. But I didn't suceed and it keeps crashing. I tried the following code:

PyObject* args = PyDict_New();
PyDict_SetItemString(args, "block", PyBool_FromLong(0));

PyObject* res = PyObject_CallObject(detail::_interpreter::get().s_python_function_show, args);
if(!res) throw std::runtime_error("Call to show() failed.");

Unfortunately I have no idea what else I could try to pass those optional arguments.

So maybe you can find the problem causing the crashes when opening more than one plot-window, or you can tell me how to pass working optional arguments such as "block"?
Thank you very much in advance!

Regards,
Patrick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions