Thank you very much. This is exactly what I was looking for. And thanks for your patients; this is my first forray into J (which is helping me avoid doing Ruby On Rails).
Regards t -------- Original Message -------- From: "Sherlock, Ric" <[EMAIL PROTECTED]> Apparently from: [EMAIL PROTECTED] To: "General forum" <[email protected]> Subject: RE: [Jgeneral] plotting collected data Date: Sat, 16 Jun 2007 03:47:32 +1200 > I don't think you can give text as "x values". You can however have text > x axis labels. > The following command should give you what you want. > > 'bar;xlabel "apples" "oranges" "red plum" "oranges"' plot 3 2 5 3 > (note the quotes are only necessary if your labels contain more than one > word each) > > If you have to start from your tally, you could create this command as > follows (I'm sure others will have more elegant methods!!) > > tally > +--------+-+ > |apples |3| > +--------+-+ > |oranges |2| > +--------+-+ > |red plum|5| > +--------+-+ > |oranges |3| > +--------+-+ > ('bar;xlabel ',' 'makecsv{."1 tally) plot ;{:"1 tally > > Where makecsv is an edited version of writecsv from the csv script, that > takes an optional left argument. > > makecsv=: 3 : 0 > ',' makecsv y > : > dat=. ,each 8!:2 each y > f=. '"'&,@(,&('"',x))@(#~ >:@(=&'"')) > dat=. f each dat > f=. <@(,&LF)@}:@; > dat=. ;f"1 dat > ) > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > > Sent: Saturday, 16 June 2007 02:30 > > To: [email protected] > > Subject: [Jgeneral] plotting collected data > > > > Hello, > > > > I have a tally of some data in box form. > > > > ----------------- > > | apples | 3 | > > ----------------- > > | oranges | 2 | > > ----------------- > > | red plum | 5 | > > ----------------- > > | oranges | 3 | > > ----------------- > > > > and would like to box plot it. > > > > According to plot data I can use a boxed array. Unfortunately > > I'm not sure how to get my tally into a boxed array. I tried > > > > I think when it talks about a "boxed array" it means this: > +---------+--------------+ > |0 1 2 3 4|90 47 58 29 22| > +---------+--------------+ > Where the first box is a list of x values, and the 2nd is the list of y > values > 'bar' plot (i.5);[EMAIL PROTECTED] > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
