emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thierry Banel <tbanelwebmin@free.fr>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] key-binding for all plotting styles
Date: Sun, 12 Oct 2014 16:05:14 +0200	[thread overview]
Message-ID: <543A8A9A.4020901@free.fr> (raw)
In-Reply-To: <87lholprgp.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

Le 12/10/2014 11:28, Nicolas Goaziou a écrit :
> Would you mind providing some documentation about the feature in the
> manual, and updating ORG-NEWS?
>
>

Done.

To see the result:
- cd to org-mode tree root
- make info
- launch Emacs
- C-u C-h i doc/org RET
- search for "Org-Plot" chapter


Have fun
Thierry


[-- Attachment #2: 0001-Document-ascii-art-plot.patch --]
[-- Type: text/x-diff, Size: 4071 bytes --]

From 916f974ed4597e3d03124089d6ce90ccd3d235cf Mon Sep 17 00:00:00 2001
From: Thierry Banel <tbanelwebmin@free.fr>
Date: Sun, 12 Oct 2014 15:23:12 +0200
Subject: [PATCH] Document ascii art plot

* doc/org.texi: Extend Gnuplot chapter to ascii art plotting.
* etc/ORG-NEWS: Document ascii art plot.
---
 doc/org.texi | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 etc/ORG-NEWS |  2 ++
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index ad872a8..91fa211 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -3258,11 +3258,16 @@ functions.
 @cindex plot tables using Gnuplot
 @cindex #+PLOT
 
-Org-Plot can produce 2D and 3D graphs of information stored in org tables
-using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
+Org-Plot can produce graphs of information stored in org tables, either
+graphically or in ascii-art.
+
+@subheading Graphical plots using @file{Gnuplot}
+
+Org-Plot produces 2D and 3D graphs using @file{Gnuplot}
+@uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
 @uref{http://xafs.org/BruceRavel/GnuplotMode}.  To see this in action, ensure
 that you have both Gnuplot and Gnuplot mode installed on your system, then
-call @code{org-plot/gnuplot} on the following table.
+call @kbd{C-c " g} or @code{M-x org-plot/gnuplot RET} on the following table.
 
 @example
 @group
@@ -3280,8 +3285,8 @@ call @code{org-plot/gnuplot} on the following table.
 Notice that Org Plot is smart enough to apply the table's headers as labels.
 Further control over the labels, type, content, and appearance of plots can
 be exercised through the @code{#+PLOT:} lines preceding a table.  See below
-for a complete list of Org-plot options.  For more information and examples
-see the Org-plot tutorial at
+for a complete list of Org-plot options.  The @code{#+PLOT:} lines are
+optional.  For more information and examples see the Org-plot tutorial at
 @uref{http://orgmode.org/worg/org-tutorials/org-plot.html}.
 
 @subsubheading Plot Options
@@ -3337,6 +3342,47 @@ may still want to specify the plot type, as that can impact the content of
 the data file.
 @end table
 
+@subheading Ascii bar plots
+
+While the cursor is on a column, typing @kbd{C-c " a} or
+@code{M-x orgtbl-ascii-plot RET} create a new column containing an ascii-art
+bars plot.  The plot is implemented through a regular column formula.  When
+the source column changes, the bar plot may be updated by refreshing the
+table, for example typing @kbd{C-u C-c *}.
+
+@example
+@group
+| Sede          | Max cites |              |
+|---------------+-----------+--------------|
+| Chile         |    257.72 | WWWWWWWWWWWW |
+| Leeds         |    165.77 | WWWWWWWh     |
+| Sao Paolo     |     71.00 | WWW;         |
+| Stockholm     |    134.19 | WWWWWW:      |
+| Morelia       |    257.56 | WWWWWWWWWWWH |
+| Rochefourchat |      0.00 |              |
+#+TBLFM: $3='(orgtbl-ascii-draw $2 0.0 257.72 12)
+@end group
+@end example
+
+The formula is an elisp call:
+@lisp
+(orgtbl-ascii-draw COLUMN MIN MAX WIDTH)
+@end lisp
+
+@table @code
+@item COLUMN
+  is a reference to the source column.
+
+@item MIN MAX
+  are the minimal and maximal values displayed.  Sources values
+  outside this range are displayed as @code{too small}
+  or @code{too large}.
+
+@item WIDTH
+  is the width in characters of the bar-plot.  It defaults to @code{12}.
+
+@end table
+
 @node Hyperlinks
 @chapter Hyperlinks
 @cindex hyperlinks
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0a5af68..a29eec6 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -96,6 +96,8 @@ would throw an error. A new variable
 ~org-table-formula-create-columns~ was added to adjust this
 behavior. It is now possible to silently add new columns, to do so
 with a warning or to explicitly ask the user each time.
+*** Ascii plot
+Ability to plot values in a column through ascii-art bars.
 ** Miscellaneous
 *** File names in links accept are now compatible with URI syntax
 Absolute file names can now start with =///= in addition to =/=. E.g.,
-- 
1.9.1


  parent reply	other threads:[~2014-10-12 14:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-13 16:02 make orgtbl-ascii-plot easier to install Thierry Banel
2014-07-28 14:40 ` Bastien
2014-08-10 22:22   ` Thierry Banel
2014-08-26  8:29     ` Nicolas Goaziou
2014-08-26 19:52       ` Thierry Banel
2014-08-26 20:27         ` Nicolas Goaziou
2014-08-26 21:42           ` Thierry Banel
2014-08-26 22:09             ` Nicolas Goaziou
2014-08-26 22:21               ` Thierry Banel
2014-08-27 21:35               ` Thierry Banel
2014-08-27 23:28                 ` Nicolas Goaziou
2014-08-28 20:46                   ` Thierry Banel
2014-08-29  9:54                     ` Nicolas Goaziou
2014-08-29 17:20                       ` Thierry Banel
2014-09-02 21:53                       ` [PATCH] " Thierry Banel
2014-09-03 18:22                         ` Nicolas Goaziou
2014-09-03 20:10                           ` A key-binding for plotting Thierry Banel
2014-09-06 14:35                           ` [PATCH] remap orgtbl-ascii-plot to C-c # Thierry Banel
2014-09-08 16:30                             ` Nicolas Goaziou
2014-09-13 17:06                               ` key-binding for all plotting styles Thierry Banel
2014-10-07 14:15                                 ` Nicolas Goaziou
2014-10-07 21:40                                   ` Thierry Banel
2014-10-11 17:46                                   ` [PATCH] " Thierry Banel
2014-10-12  9:28                                     ` Nicolas Goaziou
2014-10-12 10:00                                       ` Thierry Banel
2014-10-12 14:05                                       ` Thierry Banel [this message]
2014-10-13 16:24                                         ` Nicolas Goaziou
2014-10-13 21:16                                           ` Thierry Banel
2014-10-14 20:48                                           ` Thierry Banel
2014-10-14 21:08                                             ` Nicolas Goaziou
2014-10-14 21:26                                               ` Thierry Banel

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=543A8A9A.4020901@free.fr \
    --to=tbanelwebmin@free.fr \
    --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).