I realized my code was insufficiently general because it labels only the
highest and lowest points, so here's an example of labelling a
randomly-chosen point. The magic values of "1000" are based on my
understanding that the virtual size of the plot area is 1000x1000
"characters".
rr=. _100+20?201 NB. 20 random points to plot between _100 and 100
whrp=. ?#rr NB. Location of a point at random.
rp=. whrp{rr NB. Value of the random point
xrnd=. ":<.0.5+1000*(#rr)%~whrp NB. Estimate x-position of random pt.
span=. (>./-<./)rr
yrnd=. ":<.0.5+1000*(rp-<./rr)%span NB. Estimate y-position of random pt.
NB. Place text for random point:
pd 'textfont Courier 12 Bold;textcolor BLACK'
pd 'text ',xrnd,' ',yrnd,' Val=',":rp
pd 'pensize 5;type point'
pd <"1 rr,:~i.#rr
pd 'show'
>
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm