> From: PackRat
> 
> Ric Sherlock wrote:
> > How about something like this?
> >
> >    Months=: 'Jan Feb Mar Apr May'
> >    Days=: 31 28 31 30 31
> >    Xticpos=: ": +/\ }: 0,Days
> >    Values=: (+/Days) ?...@$ 100
> >    ('xticpos ',Xticpos,';xlabel ',Months) plot Values
> > Or:
> >    ('xticpos ',Xticpos,';xlabel ',Months,';xtic 30 1') plot Values
> 
> How would the interior lines (Days, Xticpos, Values) need to be changed
> if the data were instead a table with two columns: Date (format YYYY-
> MM-
> DD) and Value?  For even greater flexibility, assume that NOT every
> date (including occasionally the first day) within a month has any data
> (I'm thinking of stock market data as one example).  I presume that
> somehow you'd have to check for a change in the month and use that to
> calculate the Xticpos?  I'm VERY interested in seeing your solution!
> Thanks in advance!

Use dates.ijs to convert dates to day numbers.
1st of the month of earliest date is base date - subtract from day numbers to 
get x values corresponding to y values you want to plot.
Subtract the base date daynumber from day number of the 1st of each month to 
get the Xticpos.


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

Reply via email to