You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to interactively see matplotlib plots with QtAgg backend #858
OS and version: Windows 10 Pro 21H2 (64-bit) 10.0.19044
Python version (& distribution if applicable, e.g. Anaconda): 3.9.4
matplotlib
Name Version Build Channel
matplotlib 3.4.2 pypi_0 pypi
matplotlib-base 3.5.1 py39h581301d_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
The matplotlib settings are:
backend QtAgg
interactive True
non interactive False
Using VS Code or Visual Studio: 1.64.2
Actual behavior
I would like to be able to debug python scripts that use matplotlib interactively. By interactively I mean placing a break point and watching my figure update as I actually step through my code.
Expected behavior
The figure does not update when stepping through code.
Steps to reproduce:
Create a python script test.py with the following code:
As a note, your environment seems pretty strange if you have:
matplotlib 3.4.2 pypi_0 pypi
matplotlib-base 3.5.1 py39h581301d_0 conda-forge
It's as if you're mixing things and have one part of the matplotlib package from pypi in a version and another part from conda-forge in another version...
Anyways, I was able to reproduce this with an environment with matplotlib 3.5.1 from conda-forge.
The problem is that the backend being chosen now is QtAgg (I think this is something new as it usually just reported Qt5Agg or Qt4Agg).
changed the title [-]Unable to debug python matplotlib plots (related to #603)[/-][+]Unable to interactively see matplotlib plots with `QtAgg` backend[/+]on Mar 3, 2022
Activity
fabioz commentedon Mar 3, 2022
As a note, your environment seems pretty strange if you have:
It's as if you're mixing things and have one part of the matplotlib package from pypi in a version and another part from conda-forge in another version...
Anyways, I was able to reproduce this with an environment with
matplotlib3.5.1 from conda-forge.The problem is that the backend being chosen now is
QtAgg(I think this is something new as it usually just reported Qt5Agg or Qt4Agg).I'll provide a fix shortly...
Cactus 1549 (@cactus1549) as a workaround, if you can execute:
At the start of your script, things also work.
[-]Unable to debug python matplotlib plots (related to #603)[/-][+]Unable to interactively see matplotlib plots with `QtAgg` backend[/+]Enable matplotlib interactive plots with QtAgg backend. Fixes microso…
cactus1549 commentedon Mar 6, 2022
Fabio Zadrozny (@fabioz), brilliant this works, thank you!
Enable matplotlib interactive plots with QtAgg backend. Fixes microso…