I used to work in Matlab and it is really convenient (when working with big arrays/matrices and nested functions) to visualize intermediate results during debugging using plot function.
In Python I cannot plot anything in debug mode: a window with figure plot is never loaded (I am using Spyder IDE for coding and matplotlib.pyplot for plotting).
This is really annoying when debugging nested function and classes. Does anyone know a good solution? Of course, I can always output intermediate results, however it is not convenient.
Thanks, Mikhail
Ok, I found a way to show the plot without breaking the debugging process.
All you need to do is to issue plt.pause(1) command, which will display the plots, and then one can continue the debugging process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With