daleroberts / itermplot

An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.
1.49k stars 51 forks source link

ipython support #24

Closed peinan closed 7 years ago

peinan commented 7 years ago

It's a very nice library that helps me to enhance my efficiency, but I think most people using matplotlib with python are working with ipython because it has the syntax highlight and the code complementation and many other benefits than normal python shell. So, I hope there will be an update to support ipython. Thanks.

daleroberts commented 7 years ago

Hi, it already supports iPython. See the screenshots on the Github page.

On Tue, Jun 13, 2017 at 11:13 AM, peinan notifications@github.com wrote:

It's a very nice library that helps me to enhance my efficiency, but I think most people using matplotlib with python are working with ipython because it has the syntax highlight and the code complementation and many other benefits than normal python shell. So, I hope there will be an update to support ipython. Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/daleroberts/itermplot/issues/24, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjjJCS-vwkim1Y_G0sbtU_JUY6GGcs9ks5sDeIygaJpZM4N33us .

peinan commented 7 years ago

Thank you for a fast reply. Isn't it the case only run python code in the ipython shell? What I mean is to use matplotlib interactively like the python shell in your screenshot (Please see the screenshot below) . Please forgive me for my ignorance if I was doing the wrong way, and hope you can tell me the right way. Thanks.

daleroberts commented 7 years ago

What does the command 'ipy' do compared to running 'ipython'? Is it a short-cut to specify some configuration settings? Perhaps you are overriding the backend selection?

On Tue, Jun 13, 2017 at 11:28 AM, peinan notifications@github.com wrote:

Thank you for a fast reply. Isn't it the case only run python code in the ipython shell? What I mean is to use matplotlib interactively like the python shell in your screenshot (Please see the screenshot below) . Please forgive me for my ignorance if I was doing the wrong way, and hope you can tell me the right way. Thanks.

https://camo.githubusercontent.com/8c43989e5a4edc0e0df0ce3d098ab21549bf3df5/687474703a2f2f692e696d6775722e636f6d2f4e7659624c314a2e706e67

https://camo.githubusercontent.com/15f4ddb9ab645dab5f97c761afacb75ed7622787/687474703a2f2f692e696d6775722e636f6d2f655668574e6c642e706e67

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/daleroberts/itermplot/issues/24#issuecomment-307980051, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjjJCT9BHM6EyZNFaxMy7yJP2aGbX6Jks5sDeWngaJpZM4N33us .

peinan commented 7 years ago

No, 'ipy' is the same as 'ipython'.

daleroberts commented 7 years ago

Could you run the command

import matplotlib; print(matplotlib.get_backend())

and tell me the response?

On Tue, Jun 13, 2017 at 11:37 AM, peinan notifications@github.com wrote:

No, 'ipy' is the same as 'ipython'.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/daleroberts/itermplot/issues/24#issuecomment-307981361, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjjJIDRQj_ZGsx5ayq6fN1I91K8M_dkks5sDeflgaJpZM4N33us .

peinan commented 7 years ago

Okay.

In [1]: import matplotlib

In [2]: print(matplotlib.get_backend())
module://ipykernel.pylab.backend_inline

In [3]:
daleroberts commented 7 years ago

It has something to do with your config. It should say:

In [1]: import matplotlib; matplotlib.get_backend()
Out[1]: 'module://itermplot'
peinan commented 7 years ago

Oh...the python shell's matplotlib backend is the correct one.

>>> import matplotlib
>>> print(matplotlib.get_backend())
module://itermplot
>>>

Thank you for the help. I'll review my ipython settings. Please close this issue.

daleroberts commented 7 years ago

Thanks.

littlehome-eugene commented 5 years ago

I'm running inside ein (https://github.com/millejoh/emacs-ipython-notebook) and not getting the image.

In [17]:
import matplotlib; print(matplotlib.get_backend())
module://itermplot

In [16]:
import matplotlib.pyplot as plt
import numpy as np

plt.imshow(np.random.random_integers(0, 255, (100,100,3)))
plt.show()
/Users/eugenekim/virtualenvs/study/lib/python3.7/site-packages/ipykernel_launcher.py:4: DeprecationWarning: This function is deprecated. Please call randi\
nt(0, 255 + 1) instead
  after removing the cwd from sys.path.

If I run inside normal python or ipython, it works fine..