Here's a crude stab that I think does what you want. Thanks for the opportunity to dig into the plotting a bit!
load 'plot' A=:steps _2 2 8 V=:j./~ A H=:|:|. V P=: 2 <. *: 'pensize 0; color 50 255 255' plot V,H pd 'pensize 2;color BLUE' pd (]+0j1*P) steps _2 2 32 On 25 April 2014 06:52, Linda Alvord <[email protected]> wrote: > Thanks for what you sent. What caused me to be somewhat unhappy was that > plot will not allow me to select the range for the y-axis. In your graph > the y-axis goes from 0 to 2 but I want _2 to 2. > > So, I tried to make my own graph paper. To get vertical lines I needed > some > help from Bo. > > However, I think you are correct to say that I will need to put the > parabola > in the complex plane. > > I just reailized that answer may be in Raul's Red Valentine. > > require 'plot' > X=: 16 * (1&o.)^3: > Y=: 13 _5 _2 _1 +/ .* 2 o. (1+i.4)&* > plot (X j. Y"0) i: 3.15j1000 > > 'color red' plot (X j. Y"0) i: 3.15j1000 > > 'pensize 8;color red' plot (X j. Y"0) i: 3.15j1000 > > pd 'color red;pensize 8' > pd (X j. Y"0) 1j1#i: 3.15j1000 > pd 'color blue;pensize 15' > pd nn=. 3j2-~2%~(_16}.5+i:5j99)^~/1j1*1+99%~i:5j999 > pd (1.5*2-~0{tt)j."1 (1{tt)+"1 (8%~1-~i.5)+/|.400%~i.1000 [ tt=.|:+._1{nn > pd 'show' > > Linda > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of alexgian > Sent: Friday, April 25, 2014 1:15 AM > To: J Programming forum > Subject: Re: [Jprogramming] paarabola on graph paper > > Further, you seem to have specified your grid in the Argand plane, I don't > think you can mix and match with reals just like that (I may be wrong - > certainly no expert on J plotting). > So you'd have to translate your parabola to complex coords if you wanted to > display it in the same context, I think. > > > On 25 April 2014 06:00, alexgian <[email protected]> wrote: > > > Not quite sure what you're trying to do, but would this be a step in the > > right direction? > > > > > > load 'plot' > > > > do=: 13 :'({.y) +(i.>:{:y)*(--/ 2{.y)%{:y' > > > > G=:do _2 2 32 > > > > P=: 2 <. *: > > > > plot (];P) G > > > > > > In your version you have not specified x-coordinates, so it picks 0-32. > > > > By using ] you specify the x-range > > > > > > Also note that that you do not need "do", there is a plot builtin called > > "steps": > > > > plot (];P) steps _2 2 32 > > > > would achieve the same result > > > > > > > > > > > > On 25 April 2014 01:25, Linda Alvord <[email protected]> wrote: > > > >> Can anyone help me put the parabola, P, on the graph paper without > >> changing > >> the scales of the graph paper. > >> > >> load 'plot' > >> do=: 13 :'({.y) +(i.>:{:y)*(--/ 2{.y)%{:y' > >> A=:do _2 2 8 > >> V=:j./~ A > >> H=:|:|. V > >> 'pensize 2;color 50 255 255' plot H,V > >> > >> f=:*: > >> 'pensize 2;color BLUE' plot P=: 2 <. f do _2 2 32 > >> > >> Linda > >> ---------------------------------------------------------------------- > >> 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
