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.
Related
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?
My Original Error:
I am new to python and am using anaconda 4.8.3. When I try to autocomplete after math. or sentence. nothing shows up. I have tried installing both pyreadline and jedi, but both are already installed with anaconda apparently. I have not disabled or enabled anything outside of the normal process of learning to use conda, like setting up shells and feeling out how to use ipython/notebooks.
The Fix that I was able to find:
%config Completer.use_jedi = False
Put this line of code literally anywhere, I recommend making a separate text file for this specifically if you are having this issue, and you just need to run it before coding. You will need to do this every time that you open up the notebook but aside from that it is an easy fix. If you know anyone with this problem please share this with them. So far I have not found anything else that works for me, so if there is a more permanent option I would love to see it.
For ipython version 7.19.0 add the following to your ipython config file. default is at where your other profile files are lurking at
.ipython/profile_default/ipython_config.py
c.Completer.use_jedi=False
Looks like some stability issues are still being worked on.
ref IPython core.completer
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.
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.
Usually I do plotting inside of IPython Notebook with pylab mode.
Whenever I use Bokeh, I like to enable output_notebook() to show my plot inside of the IPython notebook.
Most annoying part is that Bokeh enable wheel_zoom by default which cause unintended zoom in IPython notebook.
I know I can avoid this by passing comma separated tools string what I want to include into bokeh.plotting.figure. but with this solution, I should list up the other tools but wheel_zoom.
Is there any way to exclude wheel_zoom only? or Can I disable wheel_zoom in global setting or something like that?
There is an open PR to improve this, it will be in the the 0.11 release.