emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: d.tchin <d.tchin@voila.fr>
To: emacs-orgmode@gnu.org
Subject: [Babel] gnuplot, table entry and temporary file
Date: Mon, 2 Aug 2010 10:38:43 +0000 (UTC)	[thread overview]
Message-ID: <loom.20100802T123525-774@post.gmane.org> (raw)

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 ?

             reply	other threads:[~2010-08-02 10:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02 10:38 d.tchin [this message]
2010-08-02 13:09 ` [Babel] gnuplot, table entry and temporary file d.tchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20100802T123525-774@post.gmane.org \
    --to=d.tchin@voila.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).