Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 272
Raksha Avatar asked Apr 15 '19 16:04

Raksha


People also ask

How do I open a VS Code tab in a new window?

On Windows and Linux, press CTRL + K, then release the keys and press the letter O (not Zero). On macOS, press CMD + K , then the letter O. This will open the active file tab in a new window/instance.


1 Answers

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.

like image 80
Ian Huff Avatar answered Sep 17 '22 21:09

Ian Huff