|
| |
StampPlot provides a variety of drawing coordinate systems for graphics and
data representation.

 | Relative Coordinates
In relative drawing, the coordinates of the various instructions are based on the X and Y scales of your plot. This will allow shapes to adjust accordingly to your axis. Let's try out a few.
 | Using the Log/Debug immediate window:
'Start a new plot
!NEWP
'Enable Plotting
!PLOT ON
'Delete any plot objects
!POBJ clear
|
 |
We will use:
FCIR x center ,y center, radius, color
RECT x1,y1,x2,y2,color
|
 | Enter the following instructions:
^FCIR 50,50,10,(BLUE)
^RECT 20,10,80,100,(GREEN)
Note what occurs when you use the axis control buttons to change the axis. The figures stay true to the axis values. The radius of circle is 10, which is based on the Y axis.
|
|
 | Absolute Coordinates
In absolute coordinates, the coordinate is NOT based on the scales, but on absolute positions to the plot. This allows objects to be drawn that are independent of the scales of the plot for fixed images. Coordinates using absolute coordinates as suffixed with an 'a'.
The lower-left is (0,0) and upper-right is (100,100) of the full plot area.
 |
Let's try a few examples:
We will use:
TEXT x,y, size, color, text
FPIE x-center,y-center, radius, start angle, end angle, color
^TEXT 10a,95a,2, (BROWN), Absolute!
^FPIE 50a,50a,10a,45,335,(YELLOW)
Now shift around your plot. Neither should budge.
|
 | You can mix and match the coordinate modes in a single instruction. Try this:
^FREC 10a,0a,20a,20,(RED)
Now shift around the Y axis. What occurs? Can you see why?
Try other combinations and see what interesting combinations you can make! |
 | Before shift:
 |
 | After Shift up and double Y.
 |
|
 | Timed Coordinates
With timed coordinates, in place of specifying an X coordinate, we may want it relation to the time of the plot. To do this we may use T0 to T9 (the reason for the 0 and 9 will be explained soon)
 | Start a new plot with Plotting on and try this command:
^FCIR T0,20,1a,2
Wait a few seconds and enter it again (up-arrow when in log immediate window). Notice they appear timed with your entries.
|
 | There also exist L0 to L9. They hold the last time the corresponding T0 to T9 were called.
Try this:
^RECT L1,40,T1,45,9
Wait a few seconds and enter it again (up-arrow when in log immediate window). And again.
Note how the beginning position corresponds to the end position of the last.
|
 | Again, feel free to mix and match coordinate systems for the effect you desire. |
 | NOTE: T1-T9 and L1-L9 are used in drawing analog channels 1-9. For example using
both
10,20
and
^RECT L1,40,T1,45,9
in the same program, or in macros called, will cause errors.
Channel 0 (1st value) is independent of these timers. |
|
 |
Offset Coordinates
Offset coordinates are good if you only want to define a location for an object made up of many shapes, but be able to easily reposition it. This is extremely useful in macros to design objects such as gauges while allowing the option to reposition it easily (in fact, it's why we added offset coordinates).
In offset coordinates, a starting X and Y positions are defined. All shape coordinates can then use coordinates that are offset from the starting X and Y. The 'f' is is used to denote an offset coordinate.
The initial coordinates can use any of the coordinate modes. The offset coordinates are ONLY in absolute terms.
 |
Let's try it!
With a new plot, let's use constant drawings for the heck of it this time (though you may use any of the 3 modes):
' set coordinates
@SETX 60
@SETY 100
@FREC 0f, 0f, 20f, 20f, 9
@RECT ,,,, 0
@DPIE 10f,2f,7a,45,46,14
Now shift around the plot. Notice that the positions of the shapes within the object do not change. Can you look at the figure, the starting coordinates and each offset coordinate and see the relationship?
|
 | What's with the comma string in the RECT instruction? That's a short-cut to save time and micro memory. If a piece of data from the previous instruction performs the same task (x, y, radius, etc), it may be omitted and re-used in the next instruction. LEAVE NO SPACES.
|
 | Change the SETX and SETY values and re-enter the same code for the shapes. (HINT: In the immediate box you may use up/down arrow keys)
|
|
 | Percent Coordinates
Percentage coordinates are an extension of the Offset coordinate mode. In percentage coordinates, a rectangular are is defined by the four corner points.
 | To use this mode, a rectangular area is defined by starting and end coordinates:
^SETX 10
^SETY 20
^ENDX 50
^ENDY 60
or, a single command of
^COOR SETX value, SETY value, ENDX value, ENDY value
^COOR 10,20,50,60
(The coordinates may be relative, or absolute (20a))
|
 | When plotting, a p is suffixed to use a point for a given PERCENTAGE into the coordinates box.
' Creates a rectangle covering 100 percent of the defined area.
^FREC 0p,0p,100p,100p,(BLUE)
' Creates a rectangle 10% in to 90% in X and Y
coordinates.
^FREC 10p,10p,90p,90p,(RED)

|
 | This is useful if a complex or real graphic is drawn, to be able to accurately place data or read positions independent of the size or placed location on the plot.
And, as always, the different modes may be mixed in a single instruction.
^FREC 10,20a,30p,40f,(YELLOW)
P-coordinates less than 0 and greater than 100 may be used to plot outside the defined areas.
|
|
 | Real-Time Coordinates
For the X-Axis, the real time of the plot may be used by using the date (optional) and time.
!RTIM ON
!TMAX 23:00
!TMIN 01:00
@FREC 06:00,0a,09:00,100a,(D_GREEN)
These commands will set the plot for real time from 1:00 AM to 11:00 PM, and place a green rectangle covering the area of 6:00 AM to 9:00 AM.
@FREC 12/1/02 06:00,0a,12/1/02 09:00,100a,(RED)
Don't see anything? Keep increasing the X axis until the date of 6/1/02 is in range. Can you zoom in (hold down shift,
and click-drag the area, then release) and see if it's correct?
From the current time and date to current time + 1 hour:
^FREC (PRDT),0a,[(PRDT),+,1:00],20a,(BLUE)
|
|