Search Locate Previous Next Contents

PostScrp.L2D – logical to device co-ordinates

This converts between the logical co-ordinate system used by Rain to the co-ordinates actually used to plot the APL Gui objects on the chart. You would use it if you wanted to overlay your own lines or markers on top of an existing chart, giving the data points in the same co-ordinate system as the original chart.

For example, you could try ...

ch.Name 'Test' ª ch.Plot ¼23
PG„ch.Close
RawGui PG

Then you could simply overlay the chart with a new line ...

'Test' RawGui_plot 2 2½0 0 23 12

’ cnm RawGui_plot xy;rc [1] © Illustrates adding a new line to an existing plot [2] © <xy> is given in the user's co-ordinate system [3] © <cnm> names the chart we drew the plot on. [4] rc„('#.pgi'cnm)PostScrp.L2D xy [5] © Data is now in row-column format ready to draw [6] 'pgi.poly'ŒWC'Poly'('Points'rc) ’

This will draw your new line using the chart axes. You can call this repeatedly to get the line to move around, or you could easily modify it to add several lines one after the other.

Note that this takes the argument in (x,y) format and returns the result as (r,c) so that it can be used directly to create the APL Gui object.



Continue to: PostScrp.FindHotspot – chart headings etc.
© Copyright Causeway Graphical Systems Ltd 2003