From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Lindner Subject: Problem with python session Date: Thu, 6 Oct 2016 14:41:02 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs7zQ-0004ot-9b for emacs-orgmode@gnu.org; Thu, 06 Oct 2016 08:41:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bs7zN-00024s-3D for emacs-orgmode@gnu.org; Thu, 06 Oct 2016 08:41:32 -0400 Received: from [195.159.176.226] (port=60493 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs7zM-00024E-SG for emacs-orgmode@gnu.org; Thu, 06 Oct 2016 08:41:29 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bs7zF-0002qU-OY for emacs-orgmode@gnu.org; Thu, 06 Oct 2016 14:41:21 +0200 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" To: emacs-orgmode@gnu.org Hello, I have an org file: * Overview of available basis functions #+BEGIN_SRC python :session generateBFpics :exports results :results file import matplotlib.pyplot as plt import numpy as np def set_plotoptions(): plt.xlabel("x") plt.ylabel("$\phi(x)$") plt.grid() np.seterr(invalid='ignore') x = np.linspace(-3, 3, 1000) plt.plot(x, np.log(abs(x))*np.power(x, 2)) plt.suptitle("Thin Plate Splines") plt.title("$\phi(|x|) = \log(x) \cdot x^2$") set_plotoptions() plt.savefig("bf-tps.pdf") plt.close() "bf-tps.pdf" #+END_SRC #+RESULTS: [[file:bf-tps.pdf]] #+BEGIN_SRC python :session generateBFpics :exports results :results file for shape in [1, 2, 3, 4]: plt.plot(x, np.power(shape, 2) + np.power(x,2), label = "s = %i" % shape) plt.suptitle("Multi Quadrics") plt.title("$\phi(|x|) = s^2 + x^2$") plt.legend() set_plotoptions() plt.savefig("bf-multiquadrics.pdf") plt.close() "bf-multiquadrics.pdf" #+END_SRC #+RESULTS: [[file:bf-multiquadrics.pdf]] Both PDFs are generated. But only the first one has the content I expect, the othe one is an empty plot (it's a plot, yes, but empty axes. When I copy these pieces of code into on .py file it works just great. To my understanding that just how session mode works. What could be the problem here? Thanks, Florian