MARKXY INSTRUCTIONS ON CONVERTING PIXEL DATA TO ORIGINAL UNITS
============================================================================

Once the output data file has been closed from markXY,
import the text file into Excel and convert the pixel
data into the original units of the graph.

It is best to mark the x and y axes first so their co-ordinates appear as 
the first 3 rows of data in Excel.

i.e. mark the following points first:

   1. (x0,y0) the origin
   2. (x0,y1) the maximum point on the y-axis
   3. (x1,y0) the maximum point on the x-axis

These points will be used in Excel to calculate the length of the x- and y-
axes so that the pixel data can be scaled to the original units of the graph.


^   (x0,y1) +
|           |
|           |
|           |
|           |          * (x3,y5)
|           |
|           +
            |                                       * (x5,y4)
b           |     pixel x4-x0
(units of   |<------------------------>* (x4,y3)
original    |                          |
data)       |                          |
            +                          |
|           |                          | pixel y3-y0
|           |     * (x2,y2)            |                  * (x6,y2)
|           |                          |
|           |                          |
|           |                          |
V           +----------+----------+----+-----+----------+----------+
         (x0,y0)                                                 (x1,y0)


            <----------------- a (units of original data) -------->



Once the axes have been marked you can proceed with marking any or all points
on the graph; these will be saved to the output file. Once the output file 
has been closed, import it into Excel (as comma delimited).  The imported
data will look like the following:


--+------+---------
  |  A   |    B              
--+------+---------          
1    x0        y0    <---- origin            
2    x0        y1    <---- maximum y point
3    x1        y0    <---- maximum x point
4    x2        y2  
5    x3        y5
6    x4        y3
7    x5        y4
8    x6        y2        create variable names for the columns so that
9     .         .        column A is named X and column B is named Y.
.     .         .
.     .         .        1. select column A (highlight with mouse)
.     .         .        2. choose INSERT menu, select NAME --> DEFINE
                         3. type X under "Names in Workbook" and click Add
------------------       4. click OK
                         5. select column B
                         6. choose INSERT menu, select NAME --> DEFINE
                         7. type Y under "Names in Workbook" and click Add
                         8. click OK


Converting Pixel Data to Units of Original Graph
------------------------------------------------

(a) Converting the x-axis data:

    1. click on cell C4
    2. enter the equation:   =((X-$A$1)/($A$3-$A$1))*a

       where a=(x1-x0)  in the original units of the x-axis (not pixels)

       NB:  $A$1 = x0     pixel data
            $A$3 = x1     pixel data

    3. begining from cell C4, click & drag the mouse down column C to
       highlight the cells containing data for the x-axis.

    4. select EDIT menu, choose FILL --> DOWN

    5. the original X data values will now be calculated.


(b) converting the y-axis data:

    1. click on cell D4
    2. enter the equation:   =((Y-$B$1)/($B$2-$B$1))*b

       where b=(y1-y0)  in the original units of the y-axis (not pixels)

       NB:  $B$1 = y0  pixel data
            $B$2 = y1  pixel data

    3. begining from cell D4, click & drag the mouse down column D to
       highlight the cells containing data for the y-axis.

    4. select EDIT menu, choose FILL --> DOWN

    5. the original Y data values will now be calculated.


EXAMPLE
============================================================================


^          3.0 + <---- original units
|              |(72,293)
|              |
|              |
|              |     * (105,236) <--- pixel data
|              |
|          2.0 +
               |                                       * (300,215)
b=3            |  x pixel dist = 236-72
               |<------------------------>* (236,182)
original       |                          |
height         |                          |
           1.0 +                          |
|              |                          | y pixel 
|              |     * (105,120)          | distance        * (331,120)
|              |                          | = 182-75
|              |                          |
|              |(72,75)                   |                       (399,75)
V              +----------+----------+----+-----+----------+----------+
               0          4          8          12         16         20


               <------------- original length  a=20  ----------------->



PIXEL DATA:

--+------+---------
  |  A   |    B              
--+------+---------          
1    72      75      <---- origin (corresponds to 0,0 on original graph)
2    72     293      <---- maximum y point  (corresponds to point 0,3)
3   399      75      <---- maximum x point  (corresponds to point 20,0)
4   105     120
5   105     236
6   236     182
7   300     215
8   331     120
9     .      . 
.     .      . 
.     .      .
.     .      .
------------------


On the original graph the x- and y- axes had the following units:

x axis:  from 0 to 20      Hence, a= 20-0 = 20
y axis:  from 0 to 3.0     Hence, b= 3.0 - 0 = 3



Conversion:

(a) x values -    equation = ((X-72)/(399-72))*20

(b) y values -    equation = ((Y-75)/(293-75))*3

    where X and Y are the pixel values. 



Final results after conversion:
------------------------------

--+------+---------+-------+-------
  |  A   |    B    |   C   |   D   
--+------+---------+-------+-------
1    72      75
2    72     293
3   399      75
4   105     120       2.02    0.62
5   105     236       2.02    2.22
6   236     182          .       .
7   300     215          .       .
8   331     120          .       .
9     .      .           .       .
.     .      .
.     .      .
.     .      .
------------------

for X=105, C4 = ((105-72)/(399-72))*20 =  2.02

    Y=120, D4 = ((120-75)/(293-75))*3 = 0.62      etc.




---------------------------------------------------------------------------
Frank Sanfilippo
Department of Public Health
31 May 1996          

Thanx, Frank!