Use a hook (j.f) to plot a list of complex numbers. For example: f=.2&^+3&^-4: NB. define some function plot(j.f)i:2j19 NB. plot arguments j. functionvalues
--- Den tors 11/11/10 skrev Devon McCormick <[email protected]>: > Fra: Devon McCormick <[email protected]> > Emne: Re: [Jprogramming] Labeling plot axes > Til: "Programming forum" <[email protected]> > Dato: torsdag 11. november 2010 19.55 > That's very helpful - it also gave me > the clue for extending this labeling > to 3D plots: > > 'type surface' plot (;];(f+g) +/ g-f) > i:6j99 > > Thanks... > > On Thu, Nov 11, 2010 at 12:18 PM, Thomas Costigliola > <[email protected]>wrote: > > > Devon, it can be done by adding an additional > character: > > > > plargs plot (;f, g, (f+g),: g-f) i: 6j99 > > > > If the plot data is a 2 element boxed list the first > item contains the > > x-values, the second the y-values. > > > > On Thu, Nov 11, 2010 at 12:13 PM, Devon McCormick > <[email protected]> > > wrote: > > > Hi everybody - > > > > > > I'm putting together a 5-minute presentation on J > for a "Language > > Slapdown" > > > next week here in NYC - http://www.meetup.com/Language-Slapdown/ > . > > > > > > I'd like to show a few colorful graphs but I'm > hitting a problem I've had > > > before but ignored: the default for axis labels > doesn't reflect the true > > > (X-axis) values without a lot of work. For > example, > > > > > > load 'plot' > > > > > > plargs=. 'pensize 5;key f g f+g > g-f;keystyle fat;keypos rti; ' > > > > > > plargs=. plargs ,'keyfont > Courier 14' > > > > > > > > > > > > f=: 1 0 _0.3 0.01 0.004 > &p. *NB. 1+0x-0.3x^2+0.01x^3+0.004x^4* > > > > > > g=: 3 0.5 0.1 _0.02 _0.006 > &p. *NB. 3+0.5x+0.1x^2-0.02x^3-0.006x^4* > > > > > > > > > > > > plargs plot (f, g, (f+g),: g-f) > i: 6j99 > > > > > > This gives an interesting plot but the X-axis > doesn't reflect the values > > _6 > > > to 6. If I use something like "xlabel > ',":i:6j99", the axis values are > > > unreadable as it tries to put all the numbers > in. Is there an easy way > > to > > > specify that the labels should be something like > "i:6j6" but still plot > > > against the X-values of i:6j99? > > > > > > Thanks, > > > > > > Devon > > > > > > -- > > > Devon McCormick, CFA > > > ^me^ at acm. > > > org is my > > > preferred e-mail > > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > -- > Devon McCormick, CFA > ^me^ at acm. > org is my > preferred e-mail > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
