Map the coordinate space of a canvas.
Transforms
the coordinate space of the canvas. Normally, (0,0) represents the
upper left corner of the canvas and widths and heights are measured
in pixels. By remapping the coordinate space, transformations no
longer need to be applied to coordinates when drawing. For example,
if the canvas has a width of 300 and a height of 200 and if we want
to draw a graph from -1 to +1 on the x axis and -2 to +2 on the y
axis in a region of the original canvas, we could write, say:
XADcanvasmap(id_canvas, 50, 150, 250, 50, -1, -2, 1, 2)
before plotting the points on the graph. Note that this transformation
reverts the direction of the y axis and plots everything between
(-1,1) and (-2,2) in the portion of the canvas between pixel
coordinates (50,50) and (250,150). The following figure clarifies the
effect of the
XADcanvasmap
call:
After calling this procedure, coordinates should be given in the
red
intervals. XAD will map them correctly onto the canvas, based on the
black intervals.