From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: gnuplot: plotting students' progress of grades Date: Tue, 01 Sep 2015 08:35:19 -0400 Message-ID: References: <74BD0B79-38C1-4C2A-A2C2-82E52A4826B9@friolz.com> <20150901083819.31db99e3@pckr150.mpip-mainz.mpg.de> <87d1y2ifah.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWkmd-00079k-Hf for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 08:35:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWkma-0006Jw-80 for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 08:35:27 -0400 Received: from mail-qg0-x235.google.com ([2607:f8b0:400d:c04::235]:36161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWkma-0006Jo-0q for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 08:35:24 -0400 Received: by qgeb6 with SMTP id b6so91941857qge.3 for ; Tue, 01 Sep 2015 05:35:22 -0700 (PDT) In-reply-to: <87d1y2ifah.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric S Fraga Cc: Org Mode Mailing List , Robert Klein , Tobias Frischholz You can transpose the table like this: (org-table-transpose-table-at-point) Alternatively (adapted from that code): this might get you where you need to be: #+name: my-data | 1 | 2 | 3 | 4 | | a | b | c | d | #+BEGIN_SRC emacs-lisp (defun get-transposed-table (tblname) (save-excursion (org-open-link-from-string (format "[[%s]]" tblname)) (while (not (org-table-p)) (forward-line)) (let* ((table (delete 'hline (org-table-to-lisp))) (contents (mapcar (lambda (p) (let ((tp table)) (mapcar (lambda (rown) (prog1 (pop (car tp)) (setq tp (cdr tp)))) table))) (car table)))) (mapconcat (lambda(x) (concat "| " (mapconcat 'identity x " | " ) " |\n" )) contents "")))) #+END_SRC #+RESULTS: : get-transposed-table #+BEGIN_SRC python :var data=(get-transposed-table "my-data") print data #+END_SRC #+RESULTS: : | 1 | a | : | 2 | b | : | 3 | c | : | 4 | d | : Eric S Fraga writes: > On Tuesday, 1 Sep 2015 at 08:38, Robert Klein wrote: > > [...] > >> You can use something like this: > > [...] > >> #+begin_src gnuplot :var data=grades :file noten.png >> put your gnuplot code here >> #+end_src > > The problem for the OP will be that the data are in rows instead of > columns and gnuplot will only plot columns (selected using > "using"). The table needs to be transposed first (which is possible but > don't ask me how ;-). -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu