From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Generating boxplot (candlestick) diagrams (babel or org-plot) Date: Sun, 08 Jan 2012 09:38:01 -0700 Message-ID: <87k452176e.fsf@gmx.com> References: <2012-01-08T16-41-37@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjvlG-0005mS-IR for emacs-orgmode@gnu.org; Sun, 08 Jan 2012 11:38:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjvlE-0004Lv-VN for emacs-orgmode@gnu.org; Sun, 08 Jan 2012 11:38:22 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:33456 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RjvlE-0004Lm-M9 for emacs-orgmode@gnu.org; Sun, 08 Jan 2012 11:38:20 -0500 In-Reply-To: <2012-01-08T16-41-37@devnull.Karl-Voit.at> (Karl Voit's message of "Sun, 8 Jan 2012 16:44:59 +0100") 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: news1142@Karl-Voit.at Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Karl Voit writes: > Hi! > > I'm new to babel/gnuplot/org-plot and want to generate classic > Boxplot[1] diagrams. > > My tests failed so far: > > #+TBLNAME: mydata > #+PLOT: title:"Boxplots of mydata" with:candlesticks > | A | B | > |---+---| > | 5 | 5 | > | 5 | 6 | > | 4 | 5 | > | 5 | 6 | > | 2 | 4 | > | 2 | 5 | > > ... with =C2=ABorg-plot/gnuplot=C2=BB results in: > #+begin_verse > gnuplot-mode 0.6.0 (gnuplot 4.4) -- report bugs with "C-c C-u" > Starting gnuplot plotting program...Done > > #+end_verse > > ... with nothing else. > > > #+begin_src gnuplot :var data=3Dmydata :file output.png > set title "Plot Test" > > plot data using 1:2 with candlestick > #+end_src > > ... results in empty output.png file. > In more complex examples like these I would recommend using a gnuplot code block rather than using Org-plot. Gnuplot has an extremely comprehensive built in help system, typing "help boxplot" at the gnuplot REPL returns the following. ,---- | gnuplot> help boxplot | Boxplots are a common way to represent a statistical distribution of val= ues. | Quartile boundaries are determined such that 1/4 of the points have a va= lue | equal or less than the first quartile boundary, 1/2 of the points have a= value | equal or less than the second quartile (median) value, etc. A box is dr= awn | around the region between the first and third quartiles, with a horizont= al line | at the median value. Whiskers extend from the box to user-specified lim= its. | Points that lie outside these limits are drawn individually. |=20 | Examples |=20 | # Place a boxplot at x coordinate 1.0 representing the y values in c= olumn 5 | plot 'data' using (1.0):5 |=20 | ... `---- Also see the help for "candlestick". Using this information the attached Org-mode file generates a candlestick plot using a Gnuplot code block. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=candlestick.org #+Title: Box-Plots with Gnuplot #+Options: ^:nil #+name: sample | x | box_min | whisker_min | whisker_high | box_high | |---+---------+-------------+--------------+----------| | 1 | 2 | 0 | 6 | 4 | | 2 | 3 | 1 | 7 | 5 | | 3 | 4 | 2 | 8 | 6 | | 4 | 5 | 3 | 9 | 7 | | 5 | 6 | 4 | 10 | 8 | | 6 | 7 | 5 | 11 | 9 | #+begin_src gnuplot :var data=sample :results silent set xrange [0:7] plot data using 1:2:3:4:5 with candlesticks #+end_src --=-=-= Content-Type: text/plain Best, > > > What is the problem here? At least the second method should end up > in an error message or a file with content I guess. > > 1. http://en.wikipedia.org/wiki/Boxplot -- Eric Schulte http://cs.unm.edu/~eschulte/ --=-=-=--