From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Ignore some lines when using org-plot/gnuplot Date: Sat, 14 Nov 2009 20:34:55 -0700 Message-ID: References: <4af25aef.8702be0a.6969.5c14@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9Vta-0007Sg-BK for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 22:35:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9VtV-0007S5-Q5 for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 22:35:21 -0500 Received: from [199.232.76.173] (port=52729 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9VtV-0007Rv-IE for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 22:35:17 -0500 Received: from mail-yx0-f191.google.com ([209.85.210.191]:64271) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9VtV-0005Vc-64 for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 22:35:17 -0500 Received: by yxe29 with SMTP id 29so5015166yxe.14 for ; Sat, 14 Nov 2009 19:35:15 -0800 (PST) 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: Darlan Cavalcante Moreira Cc: org-mode Mailinglist Darlan Cavalcante Moreira writes: > Hi everybody, > > Is there a way to ignore some lines when using org-plot/gnuplot to plot a table > in Org? I have a table with some expenses, but the last two lines are the total > calculated from the previous lines. I'd like to plot only the expenses and > ignore the last two lines. > > In the docs there is the option "deps" to specify which columns should be > plotted but I can't find an equivalent for lines (there is a line option but I > understand that it is used to send some extra command to gnuplot). > Hi Darlan, Sorry about the extremely delayed reply. I don't believe that what you've described is possible in the current implementation of org-plot. It is possible however using org-babel which supports gnuplot. Org-babel now allows indexing into the values of variable assignments. So for example a simple gnuplot example could graph the contents of a table by assigning that table to a variable #+tblname: squares | 1 | 1 | | 2 | 4 | | 3 | 9 | | 4 | 16 | | 5 | 25 | | 6 | 36 | #+begin_src gnuplot :var data=squares :results silent plot data using 1:2 with lines #+end_src with this new change it is possible to assign only part of the table to a variable as you've described above. For example #+tblname: squares-with-sum | 1 | 1 | | 2 | 4 | | 3 | 9 | | 4 | 16 | | 5 | 25 | | 6 | 36 | |----+----| | 21 | 91 | #+begin_src gnuplot :var data=squares-with-sum[0:-3] :results silent plot data using 1:2 with lines #+end_src For more information on indexing see the documentation of the `org-babel-ref-index-list' function. Thanks for motivating this new feature -- Eric > > > - Darlan > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode