emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [Orgmode] Unable to capture the file name generated using matplo


From: Dror Atariah
Subject: Re: [O] [Orgmode] Unable to capture the file name generated using matplotlib
Date: Tue, 26 May 2015 15:26:24 +0200

On Mon, May 25, 2015 at 8:30 PM, John Kitchin <address@hidden> wrote:
With emacs -Q, and this org file:

#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (python . t)))
#+END_SRC

#+RESULTS:

#+BEGIN_SRC python :session with_matplotlib :results file :exports both
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))            # 4
plt.plot([1,3,2])                              # 3
plt.savefig('myfig.png')                  # 2
'myfig.png'                                     # 1
#+END_SRC

#+RESULTS:
[[file:myfig.png]]

 
As I mentioned before, if I evaluate the second block as-is I get the error. However, if I comment out all the lines except #1 then the code returns the correct results block. Then, I started to add the numbered lines. Adding #2 and #3 still doesn't break the behavior. Once adding line #4 the behavior breaks. Maybe this observation can be helpful? This happens both when starting Emacs -Q or without -Q.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]