From: James TD Smith <ahktenzero@mohorovi.cc>
To: emacs-orgmode@gnu.org
Subject: [PATCH 9/9] Some bugfixes for org-plot.
Date: Sat, 20 Sep 2008 22:09:27 +0100 [thread overview]
Message-ID: <20080920210927.19759.90423.stgit@nyarlathotep.internal.mohorovi.cc> (raw)
In-Reply-To: <20080920210101.19759.15959.stgit@nyarlathotep.internal.mohorovi.cc>
* Handle tables where the first line is an hline.
* Put commas at the end of the line in generated scripts
---
lisp/org-plot.el | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 874790c..f8e268d 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -218,7 +218,7 @@ NUM-COLS controls the number of columns plotted in a 2-d plot."
(format "\"%s\" %d" (cdr pair) (car pair)))
y-labels ", "))))
(case type ;; plot command
- ('2d (dotimes (col num-cols)
+ ('2d (dotimes (col num-cols)
(unless (and (equal type '2d)
(or (and ind (equal (+ 1 col) ind))
(and deps (not (member (+ 1 col) deps)))))
@@ -239,11 +239,11 @@ NUM-COLS controls the number of columns plotted in a 2-d plot."
(setq plot-lines (list (format "'%s' with %s title ''"
data-file with)))))
(add-to-script
- (concat plot-cmd " " (mapconcat 'identity (reverse plot-lines) "\\\n ,")))
+ (concat plot-cmd " " (mapconcat 'identity (reverse plot-lines) ",\\\n ")))
script)))
;;-----------------------------------------------------------------------------
-;; facad functions
+;; facade functions
;;;###autoload
(defun org-plot/gnuplot (&optional params)
"Plot table using gnuplot. Gnuplot options can be specified with PARAMS.
@@ -255,11 +255,11 @@ line directly before or after the table."
(delete-other-windows)
(when (get-buffer "*gnuplot*") ;; reset *gnuplot* if it already running
(save-excursion
- (set-buffer "*gnuplot*") (goto-char (point-max))
+ (set-buffer "*gnuplot*") (goto-char (point-max))
(gnuplot-delchar-or-maybe-eof nil)))
(org-plot/goto-nearest-table)
;; set default options
- (mapc
+ (mapc
(lambda (pair)
(unless (plist-member params (car pair))
(setf params (plist-put params (car pair) (cdr pair)))))
@@ -267,7 +267,8 @@ line directly before or after the table."
;; collect table and table information
(let* ((data-file (make-temp-file "org-plot"))
(table (org-table-to-lisp))
- (num-cols (length (first table))))
+ (num-cols (length (if (eq (first table) 'hline) (second table)
+ (first table)))))
(while (equal 'hline (first table)) (setf table (cdr table)))
(when (equal (second table) 'hline)
(setf params (plist-put params :labels (first table))) ;; headers to labels
next prev parent reply other threads:[~2008-09-20 21:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-20 21:08 [PATCH 0/9] Update my last patchset James TD Smith
2008-09-20 21:08 ` [PATCH 1/9] Some improvements to the modeline clock display James TD Smith
2008-09-20 21:08 ` [PATCH 2/9] Fix X clipboard handling in emacs21 James TD Smith
2008-09-20 21:08 ` [PATCH 3/9] Show durations of clocked times in timeline James TD Smith
2008-09-20 21:09 ` [PATCH 4/9] Fix link display in imenus and the refile interface James TD Smith
2008-09-21 6:25 ` Carsten Dominik
2008-09-21 14:31 ` [PATCH] " James TD Smith
2008-09-21 19:40 ` Carsten Dominik
2008-09-20 21:09 ` [PATCH 5/9] Fix note insertion in entries with drawers James TD Smith
2008-10-16 4:50 ` Carsten Dominik
2008-09-20 21:09 ` [PATCH 6/9] Add some functions for handling checklists James TD Smith
2008-09-20 21:09 ` [PATCH 7/9] Add some new interaction between remember and clocked tasks James TD Smith
2008-09-20 21:09 ` [PATCH 8/9] Add a % expansion for inserting properties in remember buffers James TD Smith
2008-09-20 21:09 ` James TD Smith [this message]
2008-09-21 4:48 ` [PATCH 0/9] Update my last patchset Carsten Dominik
2008-09-21 12:21 ` James TD Smith
2008-09-21 12:43 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080920210927.19759.90423.stgit@nyarlathotep.internal.mohorovi.cc \
--to=ahktenzero@mohorovi.cc \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).