Hi Rob,

I had hoped it was this simple!  I think I got wrapped around the axle on
the  boxing/unboxing going on the only the only overlay example i could
find.  And so

plot (0 {"1 (50 1$^((-i.50)%10))),:(0 {"1 Y)

does the trick!

On Thu, Apr 6, 2017 at 8:51 AM, Rob Hodgkinson <[email protected]> wrote:

> If I understand correctly, you just want to plot 2 x 1-D data vectors as
> you say …
>
> eg if data=: i.30, maybe plot data^2 and data as 2 line plots … without
> specifying the x values.
>
>    data=:i.30
>    plot (data^2),:data
>
> This plots with an integer x-axis (since not specified 0 … n being the
> number of points)…
>
> If you want to specify the x values for which the y values have been
> calculated, add a leading cell containing the x values, here I use
> 1000*data and you see the x-axis changed to this set of x values
>    plot (1000*data);(data^2),:data
>
> The first cell is the x values (30 points but now set to 1000*i.30)
> The second cell contains the 2 sets of y values as a 2 row matrix with 30
> points in each row, as before.
>
> Suggest you try executing the above commands to plot, then substitute for
> your values.
>
> HTH, Rob
>
> > On 6 Apr 2017, at 10:15 pm, Michael Goodrich <[email protected]>
> wrote:
> >
> > I am trying to plot two 1-d data vectors in an overlay plot namely:
> >
> > plot 0 {"1 (50 1$^((-i.50)%10)),: 0 {"1 Y
> >
> > Y is a data vector s.t.
> >
> >     $ Y
> > 50 1
> >
> >
> > following the pattern:
> >
> > 'key sin(exp),cos(exp)' plot (;(sin,:cos)@:^) -: >: i:3j100
> >
> > However is does not work:
> >
> > The problem seems to be in how to package the data for plot.  try as I
> > might, I cant discern the problem from the plot examples or doc.
> >
> > Help would be appreciated!
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Dominus enim Iesus Ecclesiae Suae et,

-Michael


"Let your religion be less of a theory and more of a love affair."
                                             - G.K. Chesterton
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to