emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [org-plot] multiple graphs on a plot
@ 2010-02-03  8:14 Eric S Fraga
  2010-02-03 17:34 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Eric S Fraga @ 2010-02-03  8:14 UTC (permalink / raw)
  To: org-mode mailing list


Back in September, zwz asked about getting multiple graphs on a plot
from a table:

http://lists.gnu.org/archive/html/emacs-orgmode/2009-09/msg00354.html

There appears to be no answer to that question.  I have the same need
and I was wondering if anybody has an answer to this.  

Basically, given a table that looks like this:

| x   | y1 |   x | y2 |
| 1   |  2 | 1.5 |  3 |
| ... |    |     |    |

I want to plot y1 versus x as one line on a plot and y2 versus x as
another line on the same plot.  In gnuplot, this is straightforward:

  plot ... using 1:2, '' using 3:4

but org-plot currently assumes :ind to have just one entry.  I have
started to look at the code in org-plot to see how to generalise ind
to be a vector of columns but would rather avoid the work if somebody
else has already done this (and because although my elisp skills are
improving daily due to org-mode, they are still rather rudimentary
;-).

Thanks,
eric

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

* Re: [org-plot] multiple graphs on a plot
  2010-02-03  8:14 [org-plot] multiple graphs on a plot Eric S Fraga
@ 2010-02-03 17:34 ` Eric Schulte
  2010-02-04 13:59   ` Eric S Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2010-02-03 17:34 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: org-mode mailing list

Hi Eric,

I don't believe anyone has yet extended org-plot to support multiple
independent variable columns.  Since stating work on Org-babel [1], I
know use gnuplot source-code blocks for all of my plotting needs, as
they provide a more direct interface into gnuplot.  For example the
following should provide the functionality your are looking for...

#+tblname: my-table
|   1 | 2 | 1.5 | 3 |
|   2 | 4 |   3 | 9 |
| ... |   |     |   |

#+begin_src gnuplot :var data=my-table
  plot data using 1:2, data using 3:4
#+end_src

Cheers -- Eric

Eric S Fraga <ucecesf@ucl.ac.uk> writes:

> Back in September, zwz asked about getting multiple graphs on a plot
> from a table:
>
> http://lists.gnu.org/archive/html/emacs-orgmode/2009-09/msg00354.html
>
> There appears to be no answer to that question.  I have the same need
> and I was wondering if anybody has an answer to this.  
>
> Basically, given a table that looks like this:
>
> | x   | y1 |   x | y2 |
> | 1   |  2 | 1.5 |  3 |
> | ... |    |     |    |
>
> I want to plot y1 versus x as one line on a plot and y2 versus x as
> another line on the same plot.  In gnuplot, this is straightforward:
>
>   plot ... using 1:2, '' using 3:4
>
> but org-plot currently assumes :ind to have just one entry.  I have
> started to look at the code in org-plot to see how to generalise ind
> to be a vector of columns but would rather avoid the work if somebody
> else has already done this (and because although my elisp skills are
> improving daily due to org-mode, they are still rather rudimentary
> ;-).
>
> Thanks,
> eric
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Footnotes: 
[1]  http://orgmode.org/worg/org-contrib/babel/

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

* Re: [org-plot] multiple graphs on a plot
  2010-02-03 17:34 ` Eric Schulte
@ 2010-02-04 13:59   ` Eric S Fraga
  0 siblings, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2010-02-04 13:59 UTC (permalink / raw)
  To: Eric Schulte; +Cc: org-mode mailing list

At Wed, 03 Feb 2010 10:34:24 -0700,
Eric Schulte wrote:
> 
> Hi Eric,
> 
> I don't believe anyone has yet extended org-plot to support multiple
> independent variable columns.  Since stating work on Org-babel [1], I
> know use gnuplot source-code blocks for all of my plotting needs, as
> they provide a more direct interface into gnuplot.  For example the
> following should provide the functionality your are looking for...
> 
> #+tblname: my-table
> |   1 | 2 | 1.5 | 3 |
> |   2 | 4 |   3 | 9 |
> | ... |   |     |   |
> 
> #+begin_src gnuplot :var data=my-table
>   plot data using 1:2, data using 3:4
> #+end_src

Eric (& Tom as well),

This works like a charm!  I should have guessed that org-babel would
be able to come to the rescue :-) Many thanks.

Being able to embed such arbitrary programming languages etc is
changing my whole workflow even more than org-mode itself did.  A
typical org file of mine these days seems always to include latex,
shell commands and maxima code, and I can now add gnuplot to this set.
Interestingly, 15 years on, org-mode &co. are accomplishing what the
CMU folk wanted to do with their Andrew project, specifically their
=ez= editor.

It used to be that I hated leaving emacs to do anything; now it's
getting to the point that I hate even leaving org-mode!  I wonder if I
can embed wanderlust within org-mode... ;-)

Thanks again,
eric

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-03  8:14 [org-plot] multiple graphs on a plot Eric S Fraga
2010-02-03 17:34 ` Eric Schulte
2010-02-04 13:59   ` Eric S Fraga

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