tkf / emacs-ipython-notebook

IPython notebook client in Emacs
tkf.github.com/emacs-ipython-notebook/
GNU General Public License v3.0
548 stars 51 forks source link

ipython-notebook layer does not show inline plots #192

Open Eoksni opened 6 years ago

Eoksni commented 6 years ago

Description :octocat:

ipython-notebook layer does not render inline plots, for example this cell

import matplotlib.pyplot as plt
from numpy import random
%matplotlib inline
def plotnormal():
    return plt.plot (random.randn (1000), random.randn (1000), 'o', alpha=0.3)
plotnormal ()
plt.show()

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

Single . (dot symbol) is shown as output

Expected behaviour: :heart: :smile:

Plot should be shown

System Info :computer:

millejoh commented 6 years ago

Unfortunately I can't reproduce - everything is working on my Windows system.

Try this - put your cursor over the dot and execute C-c C-e.

If that doesn't do the trick can you do the following and post the results:

M-: (require 'ein-dev) M-x ein:dev-show-sys-info

Thanks.

Eoksni commented 6 years ago

C-c C-e doesnt change anything, still just . character instead of a plot. M-x ein:dev-show-sys-info

("EIN system info" :emacs-version "GNU Emacs 25.2.1 (x86_64-w64-mingw32)\n of 2017-04-25" :emacs-bzr-version nil :window-system w32 :emacs-variant nil :os
 (:uname "windows32 eoksni-win8 2.6.2 9200 ix86-pc AMD unknown MinGW\n" :lsb-release nil)
 :image-types
 (svg png gif tiff jpeg xpm xbm pbm)
 :image-types-available
 (svg png gif tiff jpeg xpm xbm pbm)
 :request
 (:backend curl)
 :ein
 (:version "0.13.0" :source-dir "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/ein-20171022.1720/")
 :lib
 ((:name "websocket" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/websocket-20170829.457/websocket.elc" :featurep t :version-var websocket-version :version "1.5")
  (:name "request" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/request-20170131.1747/request.elc" :featurep t :version-var request-version :version "0.3.0")
  (:name "auto-complete" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/auto-complete-20170124.1845/auto-complete.elc" :featurep t :version-var nil :version nil)
  (:name "auto-complete" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/auto-complete-20170124.1845/auto-complete.elc" :featurep t :version-var nil :version nil)
  (:name "popup" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/popup-20160709.729/popup.elc" :featurep t :version-var popup-version :version "0.5.3")
  (:name "fuzzy" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/fuzzy-20150729.2037/fuzzy.elc" :featurep nil :version-var nil :version nil)
  (:name "pos-tip" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/pos-tip-20150318.813/pos-tip.elc" :featurep t :version-var pos-tip-version :version "0.4.6")
  (:name "python" :path "e:/eoksni-dir/portable/emacs/emacs-25.2-x86_64/share/emacs/25.2/lisp/progmodes/python.elc" :featurep t :version-var nil :version nil)
  (:name "markdown-mode" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/markdown-mode-20170615.1216/markdown-mode.elc" :featurep t :version-var markdown-mode-version :version "2.3-dev")
  (:name "helm" :path "e:/eoksni-dir/portable/emacs/dotspaceemacs/elpa/helm-core-20170613.1205/helm.elc" :featurep nil :version-var nil :version nil)))

It's probably just spacemacs issue, I was actually intended to post this issue to spacemacs repo, not here :) Tomorrow I will try with emacs -Q and see if an issue persists, then I can be sure if its spacemacs-related or not.

manandearth commented 6 years ago

I have the same issue on emacs 25 on Linux Manjaro. I don't think it has to do with your mac.. ipython works as shell when executed by a pyton file but not in notebook enviornment. it looks badly formatted too. all the lines including th ' In [2]' are stacked to the left with no indentation and the code that I type appear highlighted as if it is selected by C-..

marcoleewow commented 5 years ago

I am experiencing the same issue, @Eoksni have you found out the cause of this issue?

Eoksni commented 5 years ago

@marcoleewow No, I haven't - but I haven't looked into it too much. I tried with emacs -Q and it wasn't working too, so most likely it is not related to emacs configuration. I guess the problem is with emacs installation itself (I remember Windows Emacs wasn't rendering images untill I installed some additional libs) or something with the python (I wasn't using "pure" python, instead is was from anaconda environment). Or its a bug of this package.

palbarede commented 4 years ago

I had the same problem. First I checked that the graphics had really been created by looking into the .ipynb file (with a text editor) and opening it in HTML browser with jupyter notebook. Second (with M-x customize-group RTN ein), I toggled on the variable Ein:Output Area Inlined Images, restarted Emacs etc. and it worked.