I am running Spyder v3.2.4 in Windows 10.
I have gone to Tools > Preferences > IPython console > Graphics > Graphics Backend > Automatic to get my graphs/figures in separate windows. My question is, can I change the window type used to display these graphics? For example, in the window style I have I cannot copy or print the graphic directly. Instead having to save first. Is there a way around this?
The window style I have is:
(Spyder maintainer here) Plot windows are not generated nor handled by Spyder but by Matplotlib. Unfortunately (as you correctly point out) you can only save plots in them.
Related
Is there a way to customize (e.g., JSON config) the 'Python Interactive' Window to iPython/Jupyter console that comes with the MS Python extension?
I would like to be able to adjust the size of the variable explorer pane within the window (it can't currently be resized and takes up a bit of screen space.
I would also like the iPython console to look/operate like the native iPython console. That is, have an open console and be able to submit commands just by hitting enter (vs. the default shift+enter). Ideally, I'd like to be able to have it look/operate like Spyder's interactive console. Any thoughts or ideas would be appreciated.
As a workaround I can launch an iPython session from the integrated terminal then select all code from the editor and send it to the terminal (which then gets sent into iPython), but this is not ideal and loses the advantage of the interactive window and the built-in variable explorer which is very nice! Thanks
I'm a developer on this extension. We don't currently have these customizations that you are looking for. But if you would like to report these as enhancements then you could report them on our github here:
https://github.com/microsoft/vscode-python/issues
That's the best way to get attention for adding a new feature.
I've recently switched to VSCode, and am wondering if there's a way to make the Python Interactive Window from the Jupyter support in VSCode work like the console in Spyder where I just have to select code and press ctrl+enter to send it, without having to create cells everytime.
For now I'm resigned to work with the Terminal until my code is clean and then create a cell when I have reusable code, and would like to just work directly with the PIW.
You can always change the default console setting by:
Opening the Command Palette (⇧⌘P)
Typing "Preferences:Open Settings (JSON)
Edit this line:
"python.dataScience.sendSelectionToInteractiveWindow": false
You should be able to do this with the latest python extension. The select the code you want to execute and press shift-enter. Is that not working?
For me (now) interactive mode runs after setting "jupyter.sendSelectionToInteractiveWindow": true
#FranciscoRZ. You should have seen a popup option for this, but if it didn't come up for you it can just be manually set in VSCode options. Just change this guy here:
Python->Data Science: Send Selection To Interactive Window
That should get you what you are looking for.
OP's Note: Accepting this answer because it will be the right anwser starting with the February release of VS Code Python
If you have the notebook saved as a python percentage script (which is more git friendly)
each "cell" will be delimited by # %% and the default run command is "Shift+Ctrl".
Later once you are working in the interactive window, If you want a particular cell you wrote on the fly to be in you script, there is one button which says "Paste code into file" right next to the recently executed cell in the interactive window.
And in case you are using the notebook for the sake of being able to later export it to html or pdf, once executed in the interactive window, there is an export button as well.
I'm using Spyder3.1.2 IDE with Python 3.5 in Windows 10 and would like to know how to choose whether to show my plots in the iPython console or in a separate window. I found this other question but I get an error when I type %matplotlib qt (No module named PyQt4). I have also changed the preferences to show graphics "automatically" instead of "inline", but I'm still getting them inline.
What I want to end up with is a for loop where on every iteration I add a new point to my graph, which is visible immediately and is shown in a separate window to the console.
Many thanks for your time
You can run your script in a new python console every time you run it.
For that press F6 or go to Run/Configure... and select "Execute in a new dedicated Python console.
Since this python console will not be an IPython console, there is no need to perform any other settings.
The plot should show up in a window upon plt.show().
I am working in python and using Anaconda with Spyder and I need to plot a scatter plot in a part of the code I am working on. The plot is just fine but is drawn in the console itself and the size is quite small for my needs.
My question is, how can I plot it in another window outside the ipython console? I already tried changing some of the setting like changing Graphics setting in ipython from inline to QT to tkinter. Nothing seems to work.
Any helpful suggestions?
you can just save %matplotlib qt in a .py file and you can start ipython using:
ipython -i myfile.py
Because of vision problems, I have to keep the font in my Python programs in pycharm larger than the default setting. When I execute any program, the run window comes up at the bottom and every time I have to start working on the Python code in the editor window, I have to close the run window using a mouse.
Is there a way to close it using the keyboard shortcut? I could not find anything in the key map but there are so many settings that there is a chance that I may have missed it.
I also tried with using the distraction free option and it works very well. However, when I tried to find something within the code, it does not bring up the in-line window that allows me to type the keyword is searched for.
Please suggest if there is any way to close the run window or if there is any workaround so that I can return to working in a larger editor window.
Thank you for any inputs
shift+esc will hide the run window from within PyCharm.
If you want to access the run menu use: ctrl+shift+A
You can get a helpful cheatsheet of commands from within PyCharm by going to help -> Keymap Reference. This will provide the default key mapping for Windows and Linux
Have a look at Preferences -> Keymap under Tool Windows -> Run.
On Mac it is CMD+4.