In an expensive computing application, where you expect something to take more than 0.1 seconds and probably have user input, it is usually not recommended to do intensive drawing in the GUI stream.
It is not known about your specific situation, but the general approach is if you move all the time-consuming tasks (be it computing, adjusting the image (for example, scaling)) to a stream without a GUI. Just the normal Python thread is fine, and as soon as you have the long part, you will update your GUI. Of course, when calculating it would be convenient to display some kind of waiting sign. Also turn off other controls so that a bored user cannot change anything halfway to your calculations.
I got stuck in this issue from the first days of working with Java, and later with Python, mainly in connection with network operations (which should NEVER be in the GUI thread).
In case it is image processing (or graphics generation), which takes a lot of time, the background thread can prepare the image in wxMemoryDC, and then wxDC :: Blit it in the window of your choice. I don't know if this can be done with your wxmpl.PlotPanel component, so you will have to research this.
Alexey Vassiliev
source share