emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [org-plot/gnuplot] Plotting candlestick plots
@ 2015-09-17 17:05 Foivos S. Zakkak
  2015-09-18 10:47 ` Suvayu Ali
  0 siblings, 1 reply; 3+ messages in thread
From: Foivos S. Zakkak @ 2015-09-17 17:05 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-18 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17 17:05 [org-plot/gnuplot] Plotting candlestick plots Foivos S. Zakkak
2015-09-18 10:47 ` Suvayu Ali
2015-09-18 16:27   ` Emacs-orgmode Digest, Vol 115, Issue 21 Foivos S. Zakkak

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).