emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Foivos S. Zakkak <foivos@zakkak.net>
To: emacs-orgmode@gnu.org
Subject: [org-plot/gnuplot] Plotting candlestick plots
Date: Thu, 17 Sep 2015 20:05:16 +0300	[thread overview]
Message-ID: <yx804mit0yer.fsf@zakkak.net> (raw)

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

Hello list,

I am trying to plot some candlesticks through org-plot/gnuplot,  but I
fail.

It seems that org-plot/gnuplot supports a list of numbers in deps, i.e.,
deps:(2 3 4) and then creates a string of the form:
'test.dat' using X with lines
where X is first 2 then 3 and finally 4 for deps:(2 3 4)

To plot candlesticks though, gnuplot expects a line of the form:
'test'.dat' using 1:3:2:6:5:xticlabels(7) with candlesticks whiskerbars

I thought that maybe setting deps to ("1:3:2:6:5") could give me the
result I wanted, but I was wrong.

I have traced the problem to be in org-plot/gnuplot-script, specifically
in the following code segment:

--8<---------------cut here---------------start------------->8---
(2d (dotimes (col num-cols)
      (unless (and (eq type '2d)
                   (or (and ind (equal (1+ col) ind))
                       (and deps (not (member (1+ col) deps)))))
        (setf plot-lines
              (cons
               (format plot-str data-file
                       (or (and ind (> ind 0)
                                (not text-ind)
                                (format "%d:" ind)) "")
                       (1+ col)
                       (if text-ind (format ":xticlabel(%d)" ind) "")
                       with
                       (or (nth col col-labels) (format "%d" (1+ col))))
               plot-lines)))))
--8<---------------cut here---------------end--------------->8---

This code-segment essentially goes through the columns in the data file
and checks for each of them if it is contained in `deps`, if so it
proceeds with creating a line of the form:
'test.dat' using X...

I believe an easy fix would be to unconditionally go through deps and
create a line of the form:
'test.dat' using X... where X is the corresponding element of deps.

I tried to hack it, but didn't have much success, any help is welcome.

Kind regards,
Foivos
--
WWW: foivos.zakkak.net
PGP: 7B40 69D9 29BA AE91 C0B3  220A 0846 BFD1 03F0 4EA1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 212 bytes --]

             reply	other threads:[~2015-09-17 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17 17:05 Foivos S. Zakkak [this message]
2015-09-18 10:47 ` [org-plot/gnuplot] Plotting candlestick plots Suvayu Ali
2015-09-18 16:27   ` Emacs-orgmode Digest, Vol 115, Issue 21 Foivos S. Zakkak

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=yx804mit0yer.fsf@zakkak.net \
    --to=foivos@zakkak.net \
    --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).