From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Stanton Subject: Plotting in Python block won't over-write existing file Date: Fri, 6 Mar 2015 10:41:48 -0800 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTxC8-0006b7-Vx for emacs-orgmode@gnu.org; Fri, 06 Mar 2015 13:41:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTxC4-0001RL-Vi for emacs-orgmode@gnu.org; Fri, 06 Mar 2015 13:41:56 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTxC4-0001Qy-Py for emacs-orgmode@gnu.org; Fri, 06 Mar 2015 13:41:52 -0500 Received: by pabli10 with SMTP id li10so53650870pab.2 for ; Fri, 06 Mar 2015 10:41:51 -0800 (PST) Received: from [10.0.1.2] (mortgage.Haas.Berkeley.EDU. [128.32.75.82]) by mx.google.com with ESMTPSA id qn14sm10238704pab.33.2015.03.06.10.41.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Mar 2015 10:41:49 -0800 (PST) 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: emacs-orgmode@gnu.org Here=E2=80=99s a sample Python code block: #+begin_src python :results file :exports both import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd df =3D pd.DataFrame({'date': [1900, 1901, 1902], 'x1' : [3, 4, 5], 'x2' = : [6, 7, 9]}) df.set_index('date', inplace=3DTrue, drop=3DTrue) df.plot() plt.savefig('x4.png') return 'x4.png' # return filename to org-mode #+End_src When I run it, the graph appears on the screen and in the named file, as = desired. However, if I go back, change one of the numbers, and rerun the block, = while it claims to have run OK, the graph is not updated. I only get a = new plot if I also change the file name (e.g., to x5.png). It looks like = it=E2=80=99s refusing to over-write an existing file. Is there a reason = for this, and is there a way to change this behavior? By the way, this is with org-mode 8.3beta-884-g9ed426 Thanks. Richard Stanton=