emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* using gnuplot's "splot" and "every" commands on org-mode table data
@ 2013-05-01 14:39 Paul Stansell
  2013-05-03 16:09 ` Eric Schulte
  0 siblings, 1 reply; 34+ messages in thread
From: Paul Stansell @ 2013-05-01 14:39 UTC (permalink / raw)
  To: emacs-orgmode

Hello everyone,

I'd be grateful if someone would offer me advice on using gnuplot's
"splot" and "every" commands when plotting data from a table within
org-mode.

As far as I can tell, these gnuplot commands do not work properly
because org-mode exports empty fields in tables as "" and gnuplot's
"every" and splot commands expect the data file to be formatted as a
datablock with blank lines marking the boundaries between datablocks.
(For the definition of a datablock, type "help glossary" at the
gnuplot prompt.)

I'm using org-mode version 8.0.2 and emacs version 24.2.1 on a
Fedora-18 system


To illustrate my point, consider a blocked datafile called "block.dat"
containing the following:

  1       1       2
  1       2       5
  1       3       10

  2       1       5
  2       2       8
  2       3       13

  3       1       10
  3       2       13
  3       3       18

For this file the gnuplot command

   #+begin_src gnuplot :var d="block.dat" :results silent
     plot "$d" u 2:3 ev :::0::0, "" u 2:3 ev :::1::1, "" u 2:3 ev :::2::2
   #+end_src

shows three separate lines of different colours as gnuplot
recognises the datafile as blocked data.

Also, the following command produces a surface plot

   #+begin_src gnuplot :var d="block.dat" :results silent
     splot "$d" u 1:2:3
   #+end_src

However, if I put the same data in the table below

   #+tblname: data
   | 1 | 1 |  2 |
   | 1 | 2 |  5 |
   | 1 | 3 | 10 |
   |   |   |    |
   | 2 | 1 |  5 |
   | 2 | 2 |  8 |
   | 2 | 3 | 13 |
   |   |   |    |
   | 3 | 1 | 10 |
   | 3 | 2 | 13 |
   | 3 | 3 | 18 |

and use the following plot command

   #+begin_src gnuplot :var d=data :results silent
     plot "$d" u 2:3 ev :::0::0, "" u 2:3 ev :::1::1, "" u 2:3 ev :::2::2
   #+end_src

the result is a plot of a single line of the same colour as gnuplot
joins all of the points in the data file.  This seems to be because
org-mode exports the table as

  "x"     "y"     "z"
  1       1       2
  1       2       5
  1       3       10
  ""      ""      ""
  2       1       5
  2       2       8
  2       3       13
  ""      ""      ""
  3       1       10
  3       2       13
  3       3       18

and gnuplot does not recognise this as a blocked data file because it
contains no blank lines.

The same problem occurs for

   #+begin_src gnuplot :var d=data :results silent
     splot "$d" u 1:2:3
   #+end_src

which does not produce a gridded surface plot.

Thanks for your help,

Paul

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

end of thread, other threads:[~2014-03-25 18:42 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-01 14:39 using gnuplot's "splot" and "every" commands on org-mode table data Paul Stansell
2013-05-03 16:09 ` Eric Schulte
2013-05-06 18:57   ` Achim Gratz
2013-05-09 12:54     ` Eric S Fraga
2013-05-09 20:23       ` Achim Gratz
2013-05-09 20:42         ` Eric S Fraga
2013-05-11 10:39           ` Achim Gratz
2013-05-11 12:20             ` Rick Frankel
2013-05-21 12:36             ` Eric S Fraga
2013-05-07 17:14   ` Paul Stansell
2013-05-07 18:25     ` Eric Schulte
2013-05-07 18:39       ` Paul Stansell
2013-05-08 12:46         ` Eric Schulte
2013-05-08 15:48           ` Paul Stansell
2013-05-13 21:43             ` Eric Schulte
2013-05-17 15:00               ` Eric Schulte
2013-05-17 20:18                 ` Paul Stansell
2013-05-17 20:39                   ` Eric Schulte
2013-05-17 21:33                     ` Paul Stansell
2013-08-30 17:16                       ` Paul Stansell
2013-08-30 19:13                         ` Achim Gratz
2013-05-07 18:19   ` Paul Stansell
2013-05-08 12:41     ` Eric Schulte
2013-05-08 16:00       ` Paul Stansell
2013-05-12 18:55       ` Achim Gratz
2013-05-13 21:38         ` Eric Schulte
2013-05-14  7:06           ` Achim Gratz
2014-03-25 18:42           ` Achim Gratz
2013-05-11 10:51   ` Achim Gratz
2013-09-23 14:54   ` Paul Stansell
2013-09-23 23:32     ` Eric Schulte
2013-09-24 12:05       ` Paul Stansell
2013-09-25 18:21         ` Eric Schulte
2013-09-25 20:01           ` Paul Stansell

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