This one and the other are good examples of making new plots from user
commands. The use of custom marker is a step in the right direction. 

The problem with such use of pd is that it brings forward too much 
implementation detail.

It would be good to be able to say

   'stocks' plot open,hi,lo,:close

I wonder if new plot types could be defined as addons, e.g.
    load'graphics/plot/stocks'

This is an attribute of component design: you don't have to modify and 
re-build the existing package.
Another way of looking at it is pluggable framework.
  

On Nov 23, 2008, at 15:56, "Sherlock, Ric" <[EMAIL PROTECTED]> wrote:

---Oleg Kobchenko wrote:
From: "Hahn, Harvey" <[EMAIL PROTECTED]>
Oleg Kobchenko
|As in existing error bar and high-low types, I believe the
|ticks should be drawn geometrically rather than placed as glyphs.

That makes far more sense for the general case with
resizability.
Since this thread interests me greatly, do you
have any suggestions about how one goes about drawing these things
geometrically?  (Obviously, stock market charting software
must do it this way.)  Thanks!

I had come to the same conclusion re geometrically drawn shapes. Symbols for 
the marker plot type are drawn geometrically, so I defined two new markers 
"lineleft" and "lineright" in jzplot & used a marker rather than an symbol plot 
type. That resulted in a nice, clean, accurate result although does not yet 
differentiate open>close or open<close using colour as Devon wished.

plot_ohlc3=: 3 : 0
''plot_ohlc3 y
:
hl=. 1 2{y
oc=. 0 3{y
ntics=. {:$hl
pd 'reset'
pd 'xticpos ',": i.ntics
pd 'pensize 3'
pd 'markersize 2'
pd x
pd 'color green,red'
pd 'type marker'
pd 'markers leftline,rightline'
pd oc
pd 'color blue'
pd 'type hilo'
pd hl
pd 'show'
)

The isigraph definitions I used for drawing lineleft & lineright are as follows:

isimark_lineleft=: 4 : 0
s=. rndint 4 1 * x
p=. (y -"1 s) ,"1 s
gpbuf ,gpcount 2031 ,"1 p
)

isimark_lineright=: 4 : 0
s=. rndint 4 1 * x
p=. (y -"1 s * 0 1) ,"1 s
gpbuf ,gpcount 2031 ,"1 p
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to