Thanks Björn, but I'm afraid I don't follow. Sorry if I'm missing
something obvious.

What I have is this:

data =. ((1.5e8 * i. 5) ; 0 8 12 14 14) ,: (1.6e8 * i. 5) ; 0 9 14 16 16
coords =. (>./&>@:{.@:] , >./&>@:{:@:])"1 data
labels =. 'label 1'; 'label 2'
pd 'reset'
pd"1 data
pd"1 (<. 1000 * 7e8 18 %~"(1) 0.25e8 1 +"1 coords) ('text ', ":@:[ , '
'&,@:>@:])"(1 0) labels
pd 'show'

The "coords" line finds the end point of each line in "data". The
second from last line then constructs a string 'text x y label',
taking labels from "labels" and coords from "coords", but adjusting
the coordinates approximately to match the graph axis coordinate
system. The scale and offset I judged by eye. Is there any way I write
text directly in the axis coordinate system, or obtain the
transformation data from pd?

Cheers,
Hamish

On Fri, Dec 5, 2008 at 21:21, Björn Helgason <[EMAIL PROTECTED]> wrote:
> http://www.jsoftware.com/svn/base/tags/j602a/plot/base/main/test1.ijs
>
> 2008/12/5 Hamish Harvey <[EMAIL PROTECTED]>
>
>> Hello,
>>
>> I'm enjoying getting to grips with J.
>>
>> I've just got to plotting some results, and I wonder if it is possible
>> to draw text using pd at graph coordinates. The options seem to be in
>> pixel or [0,1000] coordinate systems, both of which cover the full
>> area of the window (or pdf bounding box). I want to label the end of
>> plot lines, though.
>>
>> If not, is there any way to obtain the transformation from plot area
>> coordinates to one of these other systems?
>>
>> As an example: I have a line on a plot that ends at, say, (1.3e7, 45),
>> and want to place a label close to the end of that line.
>>
>> Thanks,
>> Hamish
>>
>> --
>> Hamish Harvey
>> Research Associate, School of Civil Engineering and Geosciences,
>> Newcastle University
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
>
> --
> Björn Helgason, Verkfræðingur
> Fugl&Fiskur ehf,
> Þerneyjarsundi 23, Hraunborgum
> Po Box 127,801 Selfoss ,
> t-póst: [EMAIL PROTECTED]
> gsm: +3546985532
> Landslags og skrúðgarðagerð, gröfuþjónusta
> http://groups.google.com/group/J-Programming
>
>
> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
>
> góður kennari getur stigið á tær án þess að glansinn fari af skónum
>         /|_      .-----------------------------------.
>        ,'  .\  /  | Með léttri lund verður        |
>    ,--'    _,'   | Dagurinn í dag                     |
>   /       /       | Enn betri en gærdagurinn  |
>  (   -.  |        `-----------------------------------'
>  |     ) |        (\_ _/)
>  (`-.  '--.)       (='.'=)
>  `. )----'        (")_(")
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Hamish Harvey
Research Associate, School of Civil Engineering and Geosciences,
Newcastle University
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to