emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Babel] gnuplot, table entry and temporary file
@ 2010-08-02 10:38 d.tchin
  2010-08-02 13:09 ` d.tchin
  0 siblings, 1 reply; 2+ messages in thread
From: d.tchin @ 2010-08-02 10:38 UTC (permalink / raw)
  To: emacs-orgmode

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 ?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Babel] gnuplot, table entry and temporary file
  2010-08-02 10:38 [Babel] gnuplot, table entry and temporary file d.tchin
@ 2010-08-02 13:09 ` d.tchin
  0 siblings, 0 replies; 2+ messages in thread
From: d.tchin @ 2010-08-02 13:09 UTC (permalink / raw)
  To: emacs-orgmode

 <d.tchin> write 



Sorry, please forget the last question. 
I have just seen a thread related to gnuplot that answers 
to this question. 

Below a link to this thread :

http://thread.gmane.org/gmane.emacs.orgmode/27990/focus=27998

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-02 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-02 10:38 [Babel] gnuplot, table entry and temporary file d.tchin
2010-08-02 13:09 ` d.tchin

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).