If the x values are the same for all y series then you only need to include it 
once:
  plot h1;y1,:y2

And for this example you don't need to explicitly state x at all because it 
will default to i.#y
  plot y1,:y2

However the format you have used is more general and will work for plots with 
different x values for each y series.

---Original Message-----
> From: [EMAIL PROTECTED] [mailto:general-
> [EMAIL PROTECTED] On Behalf Of Alex Rufon
> Sent: Monday, 21 April 2008 21:07
> To: General forum
> Subject: RE: [Jgeneral] RE: n00b plotting 2 lines
>
> Hi Ric,
>
> Thanks. I got it. I was able to plot 2 parallel lines with your
> example.:)
>    h1=. i. 10
>    y1=. 1 + 0.5 * h1 NB. y=0.5X+1
>    y2=. _2 + 0.5 * h1 NB. -3x+6y=-12
>    (h1,:h1);(y1,:y2)
> +-------------------+---------------------------------+
> |0 1 2 3 4 5 6 7 8 9| 1  1.5  2  2.5 3 3.5 4 4.5 5 5.5|
> |0 1 2 3 4 5 6 7 8 9|_2 _1.5 _1 _0.5 0 0.5 1 1.5 2 2.5|
> +-------------------+---------------------------------+
>    plot (h1,:h1);(y1,:y2)
>
> r/Alex
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Sherlock, Ric
> Sent: Monday, April 21, 2008 3:58 PM
> To: General forum
> Subject: [Jgeneral] RE: n00b plotting 2 lines
>
> plot (0 4,:0 3);1 3,:_2 _0.5
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:general-
> > [EMAIL PROTECTED] On Behalf Of Alex Rufon
> > Sent: Monday, 21 April 2008 19:41
> > To: General forum
> > Subject: [Jgeneral] n00b plotting 2 lines
> >
> > Hi.
> >
> >
> >
> > I've been doing some head-scratching here regarding plot. I want to
> > plot
> > the following coordinates:
> >
> >    line1=. 0 4;1 3
> >
> >    line2=. 0 3;_2 _0.5
> >
> > NB. Plotting separately is not a problem
> >
> >    plot line1
> >
> >    plot line2
> >
> >
> >
> > So my problem is how to plot the two lines on one page. I can't seem
> to
> > get my head around this one. :-SS
> >
> >
> >
> > Thanks for any help.
> >
> >
> >
> > r/Alex
> >
> >
> >
> > P.S.
> >
> > I already tried the plot lab and been trying to stitch and combine
> the
> > numbers together and I'm not getting the results I expect. L
> >
> > ---------------------------------------------------------------------
> -
> > For information about J forums see
> http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> 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