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: Tue, 14 Oct 2014 22:48:06 +0200	[thread overview]
Message-ID: <543D8C06.1030700@free.fr> (raw)
In-Reply-To: <87mw90ndjc.fsf@nicolasgoaziou.fr>

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

Here is the updated patch.

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

Regards
Thierry


Le 13/10/2014 18:24, Nicolas Goaziou a écrit :
>
> Some comments follow.
> ...
>
> It should be
>
>   @kbd{M-x org-plot/gnuplot @key{RET}}
>   @kbd{M-x orgtbl-ascii-plot @key{RET}}
>   @samp{too small} or @samp{too large}.
>   @samp{12}
Fixed

> Note there is also the macro
>
>   @orgcmd{C-c " g,org-plot/gnuplot}
This macro is used as bullet items in a @table
I cannot use it in the middle of a text.

> BTW is-it ASCII-art or ascii-art?
Changed to capitals.




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

From 5168483137640a896501c88740052fe5112bed54 Mon Sep 17 00:00:00 2001
From: Thierry Banel <tbanelwebmin@free.fr>
Date: Tue, 14 Oct 2014 22:34:54 +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 | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 etc/ORG-NEWS |  2 ++
 2 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 05df0eb..767fa1a 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -3258,11 +3258,17 @@ 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 @kbd{M-x org-plot/gnuplot @key{RET}} on the following
+table.
 
 @example
 @group
@@ -3280,8 +3286,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 +3343,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
+@kbd{M-x orgtbl-ascii-plot @key{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 @samp{too small}
+  or @samp{too large}.
+
+@item WIDTH
+  is the width in characters of the bar-plot.  It defaults to @samp{12}.
+
+@end table
+
 @node Hyperlinks
 @chapter Hyperlinks
 @cindex hyperlinks
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0a5af68..e94dec6 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-14 20:48 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
2014-10-13 16:24                                         ` Nicolas Goaziou
2014-10-13 21:16                                           ` Thierry Banel
2014-10-14 20:48                                           ` Thierry Banel [this message]
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=543D8C06.1030700@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).