|
@@ -51,19 +51,21 @@
|
|
"Parse an OPTIONS line and set values in the property list P.
|
|
"Parse an OPTIONS line and set values in the property list P.
|
|
Returns the resulting property list."
|
|
Returns the resulting property list."
|
|
(when options
|
|
(when options
|
|
- (let ((op '(("type" . :plot-type)
|
|
|
|
- ("script" . :script)
|
|
|
|
- ("line" . :line)
|
|
|
|
- ("set" . :set)
|
|
|
|
- ("title" . :title)
|
|
|
|
- ("ind" . :ind)
|
|
|
|
- ("deps" . :deps)
|
|
|
|
- ("with" . :with)
|
|
|
|
- ("file" . :file)
|
|
|
|
- ("labels" . :labels)
|
|
|
|
- ("map" . :map)
|
|
|
|
- ("timeind" . :timeind)
|
|
|
|
- ("timefmt" . :timefmt)))
|
|
|
|
|
|
+ (let ((op '(("type" . :plot-type)
|
|
|
|
+ ("script" . :script)
|
|
|
|
+ ("line" . :line)
|
|
|
|
+ ("set" . :set)
|
|
|
|
+ ("title" . :title)
|
|
|
|
+ ("ind" . :ind)
|
|
|
|
+ ("deps" . :deps)
|
|
|
|
+ ("with" . :with)
|
|
|
|
+ ("file" . :file)
|
|
|
|
+ ("labels" . :labels)
|
|
|
|
+ ("map" . :map)
|
|
|
|
+ ("timeind" . :timeind)
|
|
|
|
+ ("timefmt" . :timefmt)
|
|
|
|
+ ("trans" . :transpose)
|
|
|
|
+ ("transpose" . :transpose)))
|
|
(multiples '("set" "line"))
|
|
(multiples '("set" "line"))
|
|
(regexp ":\\([\"][^\"]+?[\"]\\|[(][^)]+?[)]\\|[^ \t\n\r;,.]*\\)")
|
|
(regexp ":\\([\"][^\"]+?[\"]\\|[(][^)]+?[)]\\|[^ \t\n\r;,.]*\\)")
|
|
(start 0))
|
|
(start 0))
|
|
@@ -290,8 +292,20 @@ line directly before or after the table."
|
|
(setf params (plist-put params (car pair) (cdr pair)))))
|
|
(setf params (plist-put params (car pair) (cdr pair)))))
|
|
;; collect table and table information
|
|
;; collect table and table information
|
|
(let* ((data-file (make-temp-file "org-plot"))
|
|
(let* ((data-file (make-temp-file "org-plot"))
|
|
- (table (org-table-collapse-header (org-table-to-lisp)))
|
|
|
|
- (num-cols (length (car table))))
|
|
|
|
|
|
+ (table (let ((tbl (org-table-to-lisp)))
|
|
|
|
+ (when (pcase (plist-get params :transpose)
|
|
|
|
+ ('y t)
|
|
|
|
+ ('yes t)
|
|
|
|
+ ('t t))
|
|
|
|
+ (if (memq 'hline tbl)
|
|
|
|
+ (setq tbl (apply #'cl-mapcar #'list tbl))
|
|
|
|
+ ;; When present, remove hlines as they can't (currentily) be easily transposed.
|
|
|
|
+ (setq tbl (apply #'cl-mapcar #'list
|
|
|
|
+ (remove 'hline tbl)))
|
|
|
|
+ (push 'hline (cdr tbl))))
|
|
|
|
+ tbl))
|
|
|
|
+ (num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table)
|
|
|
|
+ (nth 0 table)))))
|
|
(run-with-idle-timer 0.1 nil #'delete-file data-file)
|
|
(run-with-idle-timer 0.1 nil #'delete-file data-file)
|
|
(when (eq (cadr table) 'hline)
|
|
(when (eq (cadr table) 'hline)
|
|
(setf params
|
|
(setf params
|