From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe Brauer Subject: babel, matlab export plot to png fails Date: Sun, 13 Aug 2017 08:33:34 +0000 Message-ID: <87shgveujl.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgoLF-0004S3-PT for emacs-orgmode@gnu.org; Sun, 13 Aug 2017 04:33:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgoLC-000096-MK for emacs-orgmode@gnu.org; Sun, 13 Aug 2017 04:33:49 -0400 Received: from [195.159.176.226] (port=34434 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgoLC-00008e-FZ for emacs-orgmode@gnu.org; Sun, 13 Aug 2017 04:33:46 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dgoL3-0002F1-A0 for emacs-orgmode@gnu.org; Sun, 13 Aug 2017 10:33:37 +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 Hi I would like to execute some matlab code in org file (using GNU emacs 26 and the git version of org mode) and save the result of the plot command in a png file, so I tried #+begin_src matlab :session :exports both :file testplot.png t=[0:0.1:1]; y=sin(t); plot(t,y) print -dpng testplot.png #+end_src And also #+begin_src matlab :results output latex :exports results :file testplot.png t=[0:0.1:1]; y=sin(t); plot(t,y) print -dpng testplot.png #+end_src But the resulting png files are corrupt. I presume also the matlab commands are included in the png file which is not correct. But I don't know who to achieve that just the last command is saved in a png file. I googled without success. Does somebody know the correct syntax? Thanks Uwe Brauer