emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Babel: Processing Tables - Ignore Some Rows
@ 2012-10-30 16:05 Ian Barton
  2012-10-30 16:25 ` Thomas S. Dye
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Barton @ 2012-10-30 16:05 UTC (permalink / raw)
  To: emacs-orgmode

I am using gnuplot to plot some data from a table:

#+tblname: monthly_total_mileage
|-------+----------|
| Month | Distance |
|-------+----------|
| Jan   |   272.04 |
| Feb   |   317.11 |
| Mar   |   354.27 |
| Apr   |   288.21 |
| May   |   488.35 |
| Jun   |   444.92 |
| Jul   |   497.21 |
| Aug   |   625.35 |
| Sep   |      821 |
| Oct   |    717.9 |
| Nov   |          |
| Dec   |          |
|-------+----------|
| Total |  4826.36 |
|-------+----------|


#+begin_src gnuplot :var data=monthly_total_mileage :file 
./monthly_total_mileage.png
   reset

   set boxwidth 0.5
   set xlabel 'month'
   set ylabel 'distance, km'

   plot data u 2:xticlabels(1) notitle with boxes fs solid 0.5
#+end_src

Ideally I want Babel to ignore the Totals row, so it doesn't get 
processed and plotted by gnuplot. Is there any way of doing this? I want 
to publish the data in several formats, some of which require me to 
display the total and some of which don't.

Any other workarounds gratefully accepted.

Ian.

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

* Re: Babel: Processing Tables - Ignore Some Rows
  2012-10-30 16:05 Babel: Processing Tables - Ignore Some Rows Ian Barton
@ 2012-10-30 16:25 ` Thomas S. Dye
  2012-10-31 15:46   ` Ian Barton
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas S. Dye @ 2012-10-30 16:25 UTC (permalink / raw)
  To: ian; +Cc: emacs-orgmode

Aloha Ian,

Will indexable variable values do what you want? Something like :var
data=monthly_total_mileage[0:-3,]?
 
hth,
Tom


Ian Barton <lists@wilkesley.net> writes:

> I am using gnuplot to plot some data from a table:
>
> #+tblname: monthly_total_mileage
> |-------+----------|
> | Month | Distance |
> |-------+----------|
> | Jan   |   272.04 |
> | Feb   |   317.11 |
> | Mar   |   354.27 |
> | Apr   |   288.21 |
> | May   |   488.35 |
> | Jun   |   444.92 |
> | Jul   |   497.21 |
> | Aug   |   625.35 |
> | Sep   |      821 |
> | Oct   |    717.9 |
> | Nov   |          |
> | Dec   |          |
> |-------+----------|
> | Total |  4826.36 |
> |-------+----------|
>
>
> #+begin_src gnuplot :var data=monthly_total_mileage :file 
> ./monthly_total_mileage.png
>    reset
>
>    set boxwidth 0.5
>    set xlabel 'month'
>    set ylabel 'distance, km'
>
>    plot data u 2:xticlabels(1) notitle with boxes fs solid 0.5
> #+end_src
>
> Ideally I want Babel to ignore the Totals row, so it doesn't get 
> processed and plotted by gnuplot. Is there any way of doing this? I want 
> to publish the data in several formats, some of which require me to 
> display the total and some of which don't.
>
> Any other workarounds gratefully accepted.
>
> Ian.
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: Babel: Processing Tables - Ignore Some Rows
  2012-10-30 16:25 ` Thomas S. Dye
@ 2012-10-31 15:46   ` Ian Barton
  2012-10-31 16:02     ` Thomas S. Dye
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Barton @ 2012-10-31 15:46 UTC (permalink / raw)
  To: emacs-orgmode

Thanks Thomas that works fine. Can you point me to where indexable 
variables are documented, as my feeble search skills seem to be faiing.

Ian.

On 30/10/12 16:25, Thomas S. Dye wrote:
> Aloha Ian,
>
> Will indexable variable values do what you want? Something like :var
> data=monthly_total_mileage[0:-3,]?
>
> hth,
> Tom
>
>
> Ian Barton <lists@wilkesley.net> writes:
>
>> I am using gnuplot to plot some data from a table:
>>
>> #+tblname: monthly_total_mileage
>> |-------+----------|
>> | Month | Distance |
>> |-------+----------|
>> | Jan   |   272.04 |
>> | Feb   |   317.11 |
>> | Mar   |   354.27 |
>> | Apr   |   288.21 |
>> | May   |   488.35 |
>> | Jun   |   444.92 |
>> | Jul   |   497.21 |
>> | Aug   |   625.35 |
>> | Sep   |      821 |
>> | Oct   |    717.9 |
>> | Nov   |          |
>> | Dec   |          |
>> |-------+----------|
>> | Total |  4826.36 |
>> |-------+----------|
>>
>>
>> #+begin_src gnuplot :var data=monthly_total_mileage :file
>> ./monthly_total_mileage.png
>>     reset
>>
>>     set boxwidth 0.5
>>     set xlabel 'month'
>>     set ylabel 'distance, km'
>>
>>     plot data u 2:xticlabels(1) notitle with boxes fs solid 0.5
>> #+end_src
>>
>> Ideally I want Babel to ignore the Totals row, so it doesn't get
>> processed and plotted by gnuplot. Is there any way of doing this? I want
>> to publish the data in several formats, some of which require me to
>> display the total and some of which don't.
>>
>> Any other workarounds gratefully accepted.
>>
>> Ian.
>>
>>
>

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

* Re: Babel: Processing Tables - Ignore Some Rows
  2012-10-31 15:46   ` Ian Barton
@ 2012-10-31 16:02     ` Thomas S. Dye
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas S. Dye @ 2012-10-31 16:02 UTC (permalink / raw)
  To: ian; +Cc: emacs-orgmode

They are documented here: http://orgmode.org/manual/var.html#var, a bit
more than halfway down the long page.

All the best,
Tom

Ian Barton <lists@wilkesley.net> writes:

> Thanks Thomas that works fine. Can you point me to where indexable
> variables are documented, as my feeble search skills seem to be
> faiing.
>
> Ian.
>
> On 30/10/12 16:25, Thomas S. Dye wrote:
>> Aloha Ian,
>>
>> Will indexable variable values do what you want? Something like :var
>> data=monthly_total_mileage[0:-3,]?
>>
>> hth,
>> Tom
>>
>>
>> Ian Barton <lists@wilkesley.net> writes:
>>
>>> I am using gnuplot to plot some data from a table:
>>>
>>> #+tblname: monthly_total_mileage
>>> |-------+----------|
>>> | Month | Distance |
>>> |-------+----------|
>>> | Jan   |   272.04 |
>>> | Feb   |   317.11 |
>>> | Mar   |   354.27 |
>>> | Apr   |   288.21 |
>>> | May   |   488.35 |
>>> | Jun   |   444.92 |
>>> | Jul   |   497.21 |
>>> | Aug   |   625.35 |
>>> | Sep   |      821 |
>>> | Oct   |    717.9 |
>>> | Nov   |          |
>>> | Dec   |          |
>>> |-------+----------|
>>> | Total |  4826.36 |
>>> |-------+----------|
>>>
>>>
>>> #+begin_src gnuplot :var data=monthly_total_mileage :file
>>> ./monthly_total_mileage.png
>>>     reset
>>>
>>>     set boxwidth 0.5
>>>     set xlabel 'month'
>>>     set ylabel 'distance, km'
>>>
>>>     plot data u 2:xticlabels(1) notitle with boxes fs solid 0.5
>>> #+end_src
>>>
>>> Ideally I want Babel to ignore the Totals row, so it doesn't get
>>> processed and plotted by gnuplot. Is there any way of doing this? I want
>>> to publish the data in several formats, some of which require me to
>>> display the total and some of which don't.
>>>
>>> Any other workarounds gratefully accepted.
>>>
>>> Ian.
>>>
>>>
>>
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

end of thread, other threads:[~2012-10-31 16:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-30 16:05 Babel: Processing Tables - Ignore Some Rows Ian Barton
2012-10-30 16:25 ` Thomas S. Dye
2012-10-31 15:46   ` Ian Barton
2012-10-31 16:02     ` Thomas S. Dye

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