Search code examples
pythonmatplotlibplotgraphvisual-studio-code

Is there a way to open graphs in a new window in VSCode?


I'm graphing some stuff with matplotlib and I need to be able to zoom in on the graph. But VSCode just renders it in its Python Interactive window that I can't do anything with. Is there a way to open graphs in a their own window that allows for scaling and things?


Solution

  • I'm a developer on this extension. We don't currently support popping out graphs. If you want to vote up the issue, we have an issue filed for this support here: https://github.com/Microsoft/vscode-python/issues/4976

    Until this support is added there is a bit of a work around. You can manually use the %matplotlib ipython magic to update to non-inline rendering. Then when you show plots they will be shown in a popup window. Like so: enter image description here

    I can't tell you exactly what command to use as it might vary based on what you have installed in your environment. But %matplotlib auto or %matplotlib qt would be good places to try starting with.