Next: Getting Hardcopies
Up: GreG CookBook
Previous: Demonstration Procedure for GreG
Most additional annotations can be done using the cursor, which is
called by command DRAW .
In command DRAW , the user can specify coordinates in three available
systems :
- The USER coordinate system, as specified above, which can be defined
as the default system by command SET COORDINATE USER
- The BOX coordinate system. In this system, coordinates are offsets in
physical units from one of the 9 most remarkable points in the box
(the corners, the center and the middle of sides) numbered according
to a standard numeric keypad notation as on VT100 terminals. This
system can be specified using command SET COORDINATE BOX N, where N
can take values 1-9 to specify the corner. The default value N=0 may
also be used, it behaves differently when the command DRAW is used
with the cursor or explicitly. When using the cursor in DRAW, the
nearest remarkable point will automatically be used as the reference
point. If you use the explicit form of command DRAW, 0 behaves as 1.
-
The CHARACTER coordinate system, which is essentially the same as the
BOX system except that offsets are specified in units of character size.
This system can be specified with the command SET CHARACTER N, where N
has the same meaning and default value as in BOX. The character size
is specified by the command SET CHARACTER Size.
By typing DRAW, the cursor appears on the screen.
By hitting the appropriate key on your keyboard, you can obtain
different actions :
- R for RELOCATE defines the current cursor position as the
new pen position. Nothing visible happens because this is a pen up
movement.
- L for LINE draws a line from the current pen position to
the cursor position (pen down movement).
- M for MARKER draws a graphic marker of the current type and size
centered at the cursor position.
- A for ARROW draws an arrow from the last pen position to the
cursor position.
- T for TEXT prompts you for a string to be written at the cursor
position (with the current centering option). Enter your text, then
type RETURN, and the text will appear on the graphic screen.
- C for ``Centered TEXT'' allows to override the current centering
option. It prompts you for a string, then for the centering option you
want to use.
- E for EXIT allows you to escape from this forever looping command.
- D for DELETE destroys the vectors drawn in the last operation.
This is equivalent to CLEAR SEGMENT , except that only the segments
created by the current DRAW command can be deleted in this way.
Note that the plot is not refreshed. To refresh the plot, hit E to
EXIT from the DRAW loop and use the command ZOOM REFRESH .
After each of the precedent action but EXIT, the cursor position
becomes the
current pen position. Anything else usually gives you the cursor
coordinates. However some letters may be used to add new possibilities
in command DRAW. Never press RETURN or ^Z
while the cursor
is on, as this causes sometimes dramatic effects...
Note that by default, clipping within the box is turned off when you use
command DRAW. Clipping can be enforced for the actions LINE, ARROW
or MARKER by using the /CLIP option when
you type the command. The action TEXT is never clipped.
When there is no cursor available (no graphic device active, or no cursor
on the graphic device),
to use command DRAW you must type explicitly the complete command as
follows :
- DRAW RELOCATE Xc Yc [/BOX N] [/CHARACTER N] [/USER] [/CLIP]
to relocate the pen at position (Xc,Yc). The coordinates
is the coordinate system specified in the option, or the default
coordinate system as defined by command SET COORDINATE.
- DRAW LINE Xc Yc to draw a line
- DRAW ARROW Xc Yc to draw an arrow
- DRAW MARKER Xc Yc to draw a marker
- DRAW TEXT Xc Yc ``Text to be written'' I
to write the string ``Text to be written'' at (Xc,Yc) where
I is the centering option used (this explicit form also corresponds
to the code C used with the cursor).
This explicit form can also be used on interactive devices. The cursor
will not be called in such case. There is no explicit form for D and E.
In interactive mode, the explicit command corresponding
to the cursor action is written to the Log File and to the internal
stack. Accordingly, the stack can be replayed to produce the same
results without any interaction with the cursor.
The choice of the coordinate system is beyond the scope of this
cookbook; for a single plot it should not matter.
Next: Getting Hardcopies
Up: GreG CookBook
Previous: Demonstration Procedure for GreG
Gildas manager
1999-03-12