Specifying named functions in plot
 
   load'plot'
   P1 =: (%@ (3 0 _1 & p.))
 
a) reference by cofullname:
 
   plot _4 4 ; cofullname 'P1'

b) exposing your locale to plot
 
   plot           NB. discover plot locale
plot_jwplot_

   coinsert_jwplot_'base'   NB. expose

   plot _4 4 ; 'P1'

 

----- Original Message ----
From: Markus Schmidt-Groettrup <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, August 1, 2006 3:16:57 PM
Subject: [Jgeneral] Graphics with J


Reading the graphics Chapter of Henry Rich, J for C
I tried some functions and got different problems:

1.
      plot _4 4 ; 'sin'  NB. works fine
      P1 =: (%@ (3 0 _1 & p.))   NB. defines reciprocal of a polynomial
      plot _4 4 ; 'P1'
|value error: P1
|   {.''`(    13 :('(',(>y),') y')f.)

problem seems to be that P1 must be defined in the z-locale:

    P2_z_ =: (%@ (3 0 _1 & p.))
    plot _4 4 ; 'P2'  NB. works fine

or
   P3 =: '(%@ (3 0 _1 & p.))'
   plot _4 4 ;  P3   NB. works as well

any ideas to do it better ?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to