Next: , Previous: , Up: Graphics   [Contents][Index]


8.1 Screen Coordinates

In plotting data or displaying images in a LUX window on your screen, you can select from various coordinate systems. These coordinate systems are listed below.

DEP

The magnitude-dependent coordinate system. It corresponds to the dev system if the coordinate is negative or if the magnitude of the coordinate is greater than or equal to 1, and to the dvi system if the magnitude is less than 1.

DVI

The device-independent coordinate system. The origin is in the lower left-hand corner of the screen, and the coordinates increase toward the upper right-hand corner, which has coordinates (1,1).

DEV

The device-dependent coordinate system. The origin, with coordinates (0,0), is in the lower left-hand corner of the screen, and the coordinates increase toward the upper right-hand corner. The unit is one pixel.

PLT

The plot coordinate system. The coordinates increase from left to right and from bottom to top. The origin and scale correspond to that of the last-drawn plot window (i.e., plt point (!mxb,!myb) corresponds to dvi point (!wxb,!wyb), and plt point (!mxt,!myt) to dvi point (!wxt,!wyt)).

RPL

The relative plot-coordinate system. The origin is in the lower left-hand corner of the last drawn plot window, at dvi point (!wxb,!wyb), and the coordinates increase to (1,1) in the upper right-hand corner of the last drawn plot, at dvi point (!wxt,!wyt)).

IMG

The image coordinate system. By default, the origin is at the lower left-hand corner of the last displayed image (at dev coordinates (!tvix,!tviy), and the coordinates increase toward the upper right-hand corner. However, if SET,/YREVERSEIMG has been executed, then image coordinates are measured using the native X11 coordinate orientation, with the image origin in the upper left-hand corner and the coordinates increasing toward the lower right-hand corner. The unit is equal to !tvscale pixels.

RIM

The relative image-coordinate system. By default, the origin is at the lower left-hand corner of the last displayed image (at dev coordinates (!tvix,!tviy), and the coordinates increase toward the upper right-hand corner, whose coordinates are (1,1). However, if SET,/YREVERSEIMG has been executed, then image coordinates are measured using the native X11 coordinate orientation, with the image origin in the upper left-hand corner and the coordinates increasing toward the lower right-hand corner.

X11

The native X11 coordinate system, with its origin at the upper left-hand corner of the window, the y coordinate increasing downward, and with a unit of one pixel.

Several graphics routines allow you to specify coordinates as well as the coordinate system in which these coordinates are expressed. You specify a particular coordinate system by including a keyword corresponding to one of the coordinate system codes listed above, e.g., /PLT for the plt coordinate system. Alternatively, you can specify the coordinate system numerically through the mode keyword MODE=#coordsys.sys where sys stands for the three-letter abbreviation of the coordinate system name.

For example, you can display a box (symbol type -4) at coordinates (100,200) in the img coordinate system through command XYMOV,100,200,-4,/IMG, or XYMOV,100,200,-4,MODE=#coordsys.IMG. The latter form is more convenient if you want to allow the user to select a coordinate system through a parameter of a user-defined subroutine or function.

In older versions of LUX, image positions in routines such as tv were specified in a coordinate system that had its origin in the upper left-hand corner with the y coordinate increasing towards the bottom, and the position specified for an image was the location of its upper left-hand corner (the X11 coordinate system). TV,x,0,0 would display an image in the upper left-hand corner of the window. In the current version of LUX, image positions are specified in the dev coordinate system, and the specified position is the one of the lower left-hand corner of the image, so TV,x,0,0 displays an image in the lower left-hand corner of the window. For backwards compatibility, one can still request the older-style image coordinate specification (i.e., the X11 coordinate system) as default, by executing SET,/ULIMCOORDS, and the older-style image orientation (with the image origin in the upper left-hand corner of the image) by executing SET,/YREVERSEIMG.

See also: !mxb, !mxt, !myb, !myt, set, !tvix, !tviy, !tvscale, !wxb, !wxt, !wyb, !wyt, #coordsys


Next: , Previous: , Up: Graphics   [Contents][Index]