From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dror Atariah Subject: [Orgmode] Unable to capture the file name generated using matplotlib Date: Sat, 2 May 2015 09:48:37 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c306f081aa640515148eba Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoSAC-0000YB-72 for emacs-orgmode@gnu.org; Sat, 02 May 2015 03:48:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoSAB-0000eC-CC for emacs-orgmode@gnu.org; Sat, 02 May 2015 03:48:40 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:35759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoSAB-0000e5-70 for emacs-orgmode@gnu.org; Sat, 02 May 2015 03:48:39 -0400 Received: by oign205 with SMTP id n205so83151733oig.2 for ; Sat, 02 May 2015 00:48:38 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: schulte.eric@gmail.com, "emacs-orgmode@gnu.org" --001a11c306f081aa640515148eba Content-Type: text/plain; charset=UTF-8 Consider the following example (from the documentation): -------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<------- #+begin_src python :session :results file import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig=plt.figure(figsize=(3,2)) plt.plot([1,3,2]) fig.tight_layout() plt.savefig('images/myfig.pdf') 'images/myfig.pdf' # return this to org-mode #+end_src -------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<------- It should return something like -------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<------- #+RESULTS: [[file:images/myfig.pdf]] -------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<------- But for me it returns merely -------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<------- #+RESULTS: [[file:]] -------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<------- That is, it doesn't capture the file name that should be the last evaluation. How can I solve this problem? --001a11c306f081aa640515148eba Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Consi= der the following example (from the documentation):

-------8<-------8<-------8<-------8<-------8<-------8<-= ------8<-------8<-------8<-------
#+begin_src pytho= n :session :results file
import matplotlib
matplotlib.u= se('Agg')
import matplotlib.pyplot as plt
fig= =3Dplt.figure(figsize=3D(3,2))
plt.plot([1,3,2])
fig.ti= ght_layout()
plt.savefig('images/myfig.pdf')
&#= 39;images/myfig.pdf' # return this to org-mode
#+end_src
-------8<-------8<-------8<-------8<-------8<---= ----8<-------8<-------8<-------8<-------

It should return something like=C2=A0

-----= --8<-------8<-------8<-------8<-------8<-------8<-------8= <-------8<-------8<-------
#+RESULTS:
[[file:images/myfig.pdf]]
-------8<-------8<-------8= <-------8<-------8<-------8<-------8<-------8<-------8<= ;-------

But for me it returns merely=C2=A0

-------8<-------8<-------8<-------8<= ;-------8<-------8<-------8<-------8<-------8<-------
<= div>#+RESULTS:
[[file:]]
-------8<-------8<= -------8<-------8<-------8<-------8<-------8<-------8<---= ----8<-------

That is, it doesn't captu= re the file name that should be the last evaluation.

How can I solve this problem?
--001a11c306f081aa640515148eba--