> From: PackRat
>  
------------------------------------------------------------
load 'dates plot tables/csv'
 
Months=: _3 <\ 'JanFebMarAprMayJunJulAugSepOctNovDec'
datafile=. 'DJIA20072008.csv'
a1=. readcsv (jpath '~user\data\',datafile)
a3=. |. }. a1  NB. Drop header row
a4=. |: a3
a5=. 0 { a4
a6=. 6 { a4
a5a=. todayno getdate every a5
a5b=. a5a - (0{a5a)
monthval=. 1 { |: getdate every a5
bool=. 1 , (2 ~:/\ monthval)
Xticpos=. ": bool # a5b
mn=. bool # monthval
Label=. (mn-1) { Months
dji=. > ". each a6
('xticpos ',Xticpos,';xlabel ',; ' ',each Label) plot a5b;dji
------------------------------------------------------------
> 
> Although this "works" in the sense that it does display a plot of the
> data with tics/labels, the data and tics/labels are NOT synchronized
> (as in the plot from your July 6 posted code).  I cannot figure out
> why.  Thanks in advance for any assistance!

With two changes it looks better:
  * Drop header row
  * give xvalues (a5b) corresponding to yvalues (dji)

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

Reply via email to