Variable: org-plot/preset-plot-types
org-plot/preset-plot-types is a customizable variable defined in
org-plot.el.gz.
Value
Large value
((2d :plot-cmd "plot" :check-ind-type t :plot-func
(lambda (_table data-file num-cols params plot-str)
(let*
((type (plist-get params :plot-type))
(with (if (eq type 'grid) 'pm3d (plist-get params :with)))
(ind (plist-get params :ind))
(deps
(if (plist-member params :deps) (plist-get params :deps)))
(text-ind
(or (plist-get params :textind)
(eq (plist-get params :with) 'histograms)))
(col-labels (plist-get params :labels)) res)
(dotimes (col num-cols res)
(unless
(and (eq type '2d)
(or (and ind (equal (1+ col) ind))
(and deps (not (member (1+ col) deps)))))
(setf res
(cons
(format plot-str data-file
(or
(and ind (> ind 0) (not text-ind)
(format "%d:" ind))
"")
(1+ col)
(if text-ind (format ":xticlabel(%d)" ind)
"")
with
(or (nth col col-labels)
(format "%d" (1+ col))))
res)))))))
(3d :plot-cmd "splot" :plot-pre
(lambda (_table _data-file _num-cols params _plot-str)
(if (plist-get params :map) "set map"))
:plot-func
(lambda (_table data-file _num-cols params _plot-str)
(let*
((type (plist-get params :plot-type))
(with (if (eq type 'grid) 'pm3d (plist-get params :with))))
(list (format "'%s' matrix with %s title ''" data-file with)))))
(grid :plot-cmd "splot" :plot-pre
(lambda (_table _data-file _num-cols params _plot-str)
(if (plist-get params :map) "set pm3d map" "set map"))
:data-dump
(lambda (table data-file params _num-cols)
(let
((y-labels
(org-plot/gnuplot-to-grid-data table data-file params)))
(when y-labels (plist-put params :ylabels y-labels))))
:plot-func
(lambda (table data-file _num-cols params _plot-str)
(let*
((type (plist-get params :plot-type))
(with
(if (eq type 'grid) 'pm3d (plist-get params :with))))
(list (format "'%s' with %s title ''" data-file with)))))
(radar :plot-func
(lambda (table _data-file _num-cols params plot-str)
(list (org--plot/radar table params)))))
Documentation
List of plists describing the available plot types.
The car is the type name, and the property :plot-func must be
set. The value of :plot-func is a lambda which yields plot-lines
(a list of strings) as the cdr.
All lambda functions have the parameters of
org-plot/gnuplot-script and PLOT-STR passed to them. i.e. they
are called with the following signature: (TABLE DATA-FILE
NUM-COLS PARAMS PLOT-STR)
Potentially useful parameters in PARAMS include:
:set :line :map :title :file :ind :timeind :timefmt :textind
:deps :labels :xlabels :ylabels :xmin :xmax :ymin :ymax :ticks
In addition to :plot-func, the following optional properties may be set.
- :plot-cmd - A gnuplot command appended to each plot-line.
Accepts string or nil. Default value: nil.
- :check-ind-type - Whether the types of ind values should be checked.
Accepts boolean.
- :plot-str - the formula string passed to :plot-func as PLOT-STR
Accepts string. Default value: "'%s' using %s%d%s with %s title '%s'"
- :data-dump - Function to dump the table to a datafile for ease of
use.
Accepts lambda function. Default lambda body:
(org-plot/gnuplot-to-data table data-file params)
- :plot-pre - Gnuplot code to be inserted early into the script, just
after term and output have been set.
Accepts string, nil, or lambda function which returns string
or nil. Defaults to nil.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-plot.el.gz
(defcustom org-plot/preset-plot-types
'((2d :plot-cmd "plot"
:check-ind-type t
:plot-func
(lambda (_table data-file num-cols params plot-str)
(let* ((type (plist-get params :plot-type))
(with (if (eq type 'grid) 'pm3d (plist-get params :with)))
(ind (plist-get params :ind))
(deps (if (plist-member params :deps) (plist-get params :deps)))
(text-ind (or (plist-get params :textind)
(eq (plist-get params :with) 'histograms)))
(col-labels (plist-get params :labels))
res)
(dotimes (col num-cols res)
(unless (and (eq type '2d)
(or (and ind (equal (1+ col) ind))
(and deps (not (member (1+ col) deps)))))
(setf res
(cons
(format plot-str data-file
(or (and ind (> ind 0)
(not text-ind)
(format "%d:" ind)) "")
(1+ col)
(if text-ind (format ":xticlabel(%d)" ind) "")
with
(or (nth col col-labels)
(format "%d" (1+ col))))
res)))))))
(3d :plot-cmd "splot"
:plot-pre (lambda (_table _data-file _num-cols params _plot-str)
(if (plist-get params :map) "set map"))
:plot-func
(lambda (_table data-file _num-cols params _plot-str)
(let* ((type (plist-get params :plot-type))
(with (if (eq type 'grid) 'pm3d (plist-get params :with))))
(list (format "'%s' matrix with %s title ''"
data-file with)))))
(grid :plot-cmd "splot"
:plot-pre (lambda (_table _data-file _num-cols params _plot-str)
(if (plist-get params :map) "set pm3d map" "set map"))
:data-dump (lambda (table data-file params _num-cols)
(let ((y-labels (org-plot/gnuplot-to-grid-data
table data-file params)))
(when y-labels (plist-put params :ylabels y-labels))))
:plot-func
(lambda (table data-file _num-cols params _plot-str)
(let* ((type (plist-get params :plot-type))
(with (if (eq type 'grid) 'pm3d (plist-get params :with))))
(list (format "'%s' with %s title ''"
data-file with)))))
(radar :plot-func
(lambda (table _data-file _num-cols params plot-str)
(list (org--plot/radar table params)))))
"List of plists describing the available plot types.
The car is the type name, and the property :plot-func must be
set. The value of :plot-func is a lambda which yields plot-lines
\(a list of strings) as the cdr.
All lambda functions have the parameters of
`org-plot/gnuplot-script' and PLOT-STR passed to them. i.e. they
are called with the following signature: (TABLE DATA-FILE
NUM-COLS PARAMS PLOT-STR)
Potentially useful parameters in PARAMS include:
:set :line :map :title :file :ind :timeind :timefmt :textind
:deps :labels :xlabels :ylabels :xmin :xmax :ymin :ymax :ticks
In addition to :plot-func, the following optional properties may
be set.
- :plot-cmd - A gnuplot command appended to each plot-line.
Accepts string or nil. Default value: nil.
- :check-ind-type - Whether the types of ind values should be checked.
Accepts boolean.
- :plot-str - the formula string passed to :plot-func as PLOT-STR
Accepts string. Default value: \"'%s' using %s%d%s with %s title '%s'\"
- :data-dump - Function to dump the table to a datafile for ease of
use.
Accepts lambda function. Default lambda body:
(org-plot/gnuplot-to-data table data-file params)
- :plot-pre - Gnuplot code to be inserted early into the script, just
after term and output have been set.
Accepts string, nil, or lambda function which returns string
or nil. Defaults to nil."
:group 'org-plot
:type 'alist)