Spyder IDE plots - python

I use Anaconda Spyder IDE, I was wondering if anyone knows how does Spyder plots really work? I can visualise any graph which is a matplotlib figure instance on spyder plots. However I did try to use Dexplot which creates matplotlib figure instance but I cannot visualise anything in the Spyder plot but I can save the graph as pdf.
Dexplot doesn`t show any plot
Any suggestion why this can happen? Could be something to do in the way Spyder plots work?

Related

Drawing on jupyter notebooks on DataSpell

I know this is "seeking for recommendations", but I have no experience with this.
I'm looking for a library for basic drawing in jupyter notebooks.
In particular I don't want libraries like plotly or matplotlib, since I don't need to draw graphs.
I'm looking for something like Canvas for JS.
I've already tested ipycanvas and tkinter but they don't work on DataSpell:
You can use the package turtle to produce drawings in Python.

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?
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:
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.

Getting Visual Studio Code Figure in Anaconda Python

I was trying Visual Studio Code that comes with Anaconda
There was heaps of problems that I could not get a simple python code to run successfully there
but on the other hand there was some really nice features
beside the autocomplete feature that I liked
Using the standard plotting
import matplotlib.pyplot as plt
plt.scatter(df['Col1'], df['Col2'])
there was the Figure which gives you many options to do with the graph including zoom in, change access and many more.
is there something similar or any other way that can give me same Figure feature in VSCode?
Make sure you select an Anaconda environment and then if you use the Jupyter support you can get the plots shown in the interactive window.

Matplotlib figure windows cannot be focused or switched to through cmd+tab

I'm using matplotlib 2.2.2. with ipython 3.6.5 (both from anaconda) for data analysis. Whenever I create a figure window with some boilerplate code like
import matplotlib.pyplot as plt
plt.ion()
plt.plot()
I get a nice figure window to which I can only switch focus by using with the mouse. These figure windows are not part of the list of macosx application switcher (accessible through cmd+tab shortcut). I've tried the osx and the qt5 backends, but I get the same results as described before.
Do you know any solution/workaround for this? It would be very practical to be able to switch focus between figure windows from the keyboard, as I often find myself browsing through the figure windows looking for the graph I'm interested in. Moreover, if matplotlib's figure windows were actual cocoa/macos windows, it would be extremely useful to those out there who use tiling window managers on osx.

Spyder won't plot figures inline

I have somehow messed up my Spyder configuration and the plots are no longer shown inline (in the IPython console). I followed the steps, described here:
Spyder Plot Inline
But I don't want to reset my configuration in order to get it work. Is there another way? I tried around a lot but can't figure it out.
Ok, this was a simple mistake. I didn't actually run the code in the IPython console but in the normal Python console.

Categories