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
Plots not displaying (matplotlib with TkAgg) #16721
To reprouce
import matplotlib
matplotlib.use('TkAgg') # not working even with default 'agg'
from matplotlib import pyplot as plt
plt.figure()
#plt.bar(foo,bar)
plt.show()
VS Code version: Code 1.58.1 (2aeda6b18e13c4f4f9edf6667158a6b8d408874b, 2021-07-13T06:58:28.115Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-1051-azure
System Info
Item
Value
CPUs
Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz (8 x 2112)
Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.
This is normal python. Plots are working fine in notebooks.
To reproduce
import matplotlib
matplotlib.use('TkAgg') # not working even with default 'agg'
from matplotlib import pyplot as plt
plt.figure()
#plt.bar(foo,bar)
plt.show()
Binil Kuriachan (@bkuriach) I asked about debugging because we recently addressed an issue with debugging and plotting. Can you describe when you mean by running. Are you executing the script manually by typing python <script-path> in VS Code terminal? or are you running using a UI? If you are using the UI, are you using a virtual environment?
Karthik Nadig (@karthiknadig) Sorry for hijacking the thread, but I seem to experience what you described: When I debug a script inside VSCode (UI: run->start debugging, or press F5), it seems to force the pyplot interactive mode to be on with the log "Backend Qt5Agg is interactive backend. Turning interactive mode on." Then plt.show() instantly returns. If I run the same script outside VSCode then it works fine. I am using a conda environment. My python extension version is v2021.7.1060902895, and VSCode version 1.58.2. Has this already been fixed?
Karthik Nadig (@karthiknadig)Ctrl+F5 works fine. Also, not sure but I think even when running with F5, the problem only happens if you actually set a breakpoint.
Karthik Nadig (@karthiknadig): Still facing the issue.. Please let me know if you need any more details. I have provided steps to reproduce the issue (make sure you are using AML remote extension and it is connected to AML Compute). Its not in debug mode
Activity
bkuriach commentedon Jul 15, 2021
Using VSCode from AML
kieferrm commentedon Jul 17, 2021
This is code in a normal python file, a notebook? Pls give us the steps to reproduce the problem.
kieferrm commentedon Jul 17, 2021
/needsMoreInfo
vscode-triage-bot commentedon Jul 17, 2021
Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.
Happy Coding!
bkuriach commentedon Jul 19, 2021
This is normal python. Plots are working fine in notebooks.
To reproduce
import matplotlib
matplotlib.use('TkAgg') # not working even with default 'agg'
from matplotlib import pyplot as plt
plt.figure()
#plt.bar(foo,bar)
plt.show()
karthiknadig commentedon Jul 19, 2021
Binil Kuriachan (@bkuriach) Is this when debugging?
bkuriach commentedon Jul 19, 2021
No, in normal execution (executed as block using shift+enter).
Like I said before, I am Using VSCode from AML.
karthiknadig commentedon Jul 19, 2021
Binil Kuriachan (@bkuriach) I asked about debugging because we recently addressed an issue with debugging and plotting. Can you describe when you mean by running. Are you executing the script manually by typing
python <script-path>in VS Code terminal? or are you running using a UI? If you are using the UI, are you using a virtual environment?karthiknadig commentedon Jul 19, 2021
Do you get a different result running this from VS Code terminal and terminal outside of VS Code?
MangoSister commentedon Jul 23, 2021
Karthik Nadig (@karthiknadig) Sorry for hijacking the thread, but I seem to experience what you described: When I debug a script inside VSCode (UI: run->start debugging, or press F5), it seems to force the pyplot interactive mode to be on with the log "Backend Qt5Agg is interactive backend. Turning interactive mode on." Then
plt.show()instantly returns. If I run the same script outside VSCode then it works fine. I am using a conda environment. My python extension version is v2021.7.1060902895, and VSCode version 1.58.2. Has this already been fixed?karthiknadig commentedon Jul 24, 2021
MangoSister Do you see a difference if you run with
Ctrl+F5(i.e, Run without debugging)?MangoSister commentedon Jul 24, 2021
Karthik Nadig (@karthiknadig)
Ctrl+F5works fine. Also, not sure but I think even when running withF5, the problem only happens if you actually set a breakpoint.bkuriach commentedon Aug 7, 2021
To reproduce the issue, please execute below code in block (Shift+Enter), I don't see the plot. (VSCODE from Azure Machine Learning)
bkuriach commentedon Oct 7, 2021
Karthik Nadig (@karthiknadig): Still facing the issue.. Please let me know if you need any more details. I have provided steps to reproduce the issue (make sure you are using AML remote extension and it is connected to AML Compute). Its not in debug mode
karthiknadig commentedon Dec 2, 2021
This is a duplicate of microsoft/vscode-tools-for-ai#1297