From mboxrd@z Thu Jan 1 00:00:00 1970 From: d.tchin Subject: [Babel] gnuplot, table entry and temporary file Date: Mon, 2 Aug 2010 10:38:43 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=59476 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfsQ4-0004aL-GH for emacs-orgmode@gnu.org; Mon, 02 Aug 2010 06:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfsQ3-0005VM-9s for emacs-orgmode@gnu.org; Mon, 02 Aug 2010 06:38:56 -0400 Received: from lo.gmane.org ([80.91.229.12]:35352) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfsQ2-0005V0-Ts for emacs-orgmode@gnu.org; Mon, 02 Aug 2010 06:38:55 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OfsQ1-0004rz-6X for emacs-orgmode@gnu.org; Mon, 02 Aug 2010 12:38:53 +0200 Received: from APuteaux-754-1-30-218.w90-44.abo.wanadoo.fr ([90.44.69.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Aug 2010 12:38:53 +0200 Received: from d.tchin by APuteaux-754-1-30-218.w90-44.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Aug 2010 12:38:53 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Before asking my question, I would like to give few remarks about use of gnuplot with org-babel and the reason why I asked this question. I tried to use it with org-plot but I was not really satisfied as it didn't work clearly well with emacs installed on MS Windows. Below a thread about this problem : http://thread.gmane.org/gmane.emacs.orgmode/15036/focus=15032 Since gnuplot is available from Babel I tried to use to check if I have less problem with MS Windows. If I used it with session none and make a redirection to output file, it works well for me. Below an example the way I use it : --8<---------------cut here---------------start------------->8--- #+begin_src gnuplot :session none :file out.png set terminal png set xlabel "gx";set ylabel "gy";set zlabel "gz" set grid xtics ytics set view 0,0 plot cos(x) #+end_src --8<---------------cut here---------------end--------------->8--- #+results: [[file:out.png]] With org-plot it was possible to give a table in entry. Org-plot was able to write temporary file that was used by gnuplot. I haven't seen such a wrapped function for gnuplot use with babel and I wonder if it is possible to pass a table in gnuplot block that will create a generic tmpfile.dat used by gnuplot ? Is there a elisp function that could be use to create such file that could be used afterwards ? Something that could look like this : --8<---------------cut here---------------start------------->8--- #+tblname: tablein | A | B | +--------+-------+ | 257.72 | 21.39 | | 165.77 | 19.68 | | 71.00 | 11.50 | | 134.19 | 14.33 | | 257.56 | 17.67 | #+lob: functiontowrite(table=tablein, filename="tmpfile_tablein.txt") --8<---------------cut here---------------end--------------->8--- An then use tmpfile_tablein.txt in gnuplot block. --8<---------------cut here---------------start------------->8--- #+begin_src gnuplot :session none :file test.png set terminal png plot 'tmpfile_tablein.txt' us 1:2 #+end_src --8<---------------cut here---------------end--------------->8--- Is there a tips that could be used to approach this way of doing ?