WDEF (Define coordinates of data window)

The WDEF command defines the user (data) coordinates to be applied to the limits of the currently defined plotting window (e.g. from the WIND command). After this command, drawing can be done in world coordinates relative to reference point 0.

Command Syntax:

WDEF x1,y1,x2,y2,sx,sy,dopt

Command Parameters:

x1,y1

The data coordinates to be assigned to the lower left corner of the current plot window.

x2,y2

The data coordinates to be assigned to the upper right corner of the current plot window.

sx,sy

The scale factors in (data units)/(map unit) in the X and Y directions from x1,y1.

If these parameters are defined, x2,y2 are ignored.

dopt

Default option:

 

0

Leave undefined parameters as they are currently defined. This allows you to simply change the origin or scaling factor of the window without re-setting other parameters. This is the default.

 

1

Set undefined parameters based on the limits of the current X and Y data buffers. This allows you to easily fit your data into the defined plotting window.

 

2

This is the same as option 1, except that after defining (or reading) sx,sy, the upper right corner of the window will be re-located to fit the XY data buffer.

  • This command effectively defines the mapping of user ground or world coordinates to map coordinates. Subsequent plotting from reference point 0 will use this mapping.
  • Changing the window size after defining coordinate mapping with the WDEF command will not affect where data is plotted. This will only affect how data is clipped if clipping is on, and where the window is annotated.
  • Example

    The following is a simple example that draws the same diagonal line twice, one using world coordinates and one using map coordinates:

    PAGE 1,1,40,24 /define a plotting page

    WIND 1,2,2,,,10,10 /define a 10x10 cm data window

    WDEF 0,20000,100,25000 /define world mapping to window

    LINA 0,0,20000,100,25000 /draws a diagonal across window

    LINA 1,2,2 /same line in map units

    12,12 

    The following example reads data from an XYZ file and scales the data window to plot the data:

    PAGE 1,1,40,24 /define plotting page

    DOPN mag 2 /open MAG.XYZ to read second A

    DXYZ L100 /read Line 100

    DMOV Z,Y /move Z into Y buffer

    WIND 1,2,15,22,23 /define a data window

    WDEF ,,,,,,1 /map window to X,Y buffers

    WIND 1,2,14,22,24 /redefine window with margin above and below a profile

    LINA 0 /plot buffer as world coord.

    RECT 12 /draw a box around window

    This control file will draw a scaled profile of the data in the second column of Line 100 in data file MAG.XYZ.

  • This command is part of the MAPPLOT GX.