0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-30 09:32:52 +00:00
org-mode/contrib/babel/library-of-babel.org
2009-09-11 13:56:14 -06:00

1.4 KiB

The Library of Babel

Introduction

The Library of Babel is an extensible collection of ready-made and easily-shortcut-callable source-code blocks for handling common tasks. Org-babel comes pre-populated with the source-code blocks located in this file. It is possible to add source-code blocks from any org-mode file to the library by calling (org-babel-lob-ingest "path/to/file.org").

Plotting code

R

Plot column 2 (y axis) against column 1 (x axis). Columns 3 and beyond, if present, are ignored.

plot(data)
1 2
2 4
3 9
4 16
5 25
nil

Gnuplot

Table/Matrix manipulation

Elegant lisp code for transposing a matrix.

1 2 3
4 5 6
  (apply #'mapcar* #'list table)
1 4
2 5
3 6

Misc

a
a + b