Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada
 
Français Contact Us Help Search Canada Site
Home What's New DFO National Site Map Media

Fisheries & Oceans
 
 
Maritimes Region
Fishing Industry
General Public
Marine & Oceans Industry
Media
Students and Teachers
Scientists and Researchers
 
AconIcon ACON       Home/Topics   |   Commands

Point Estimates


The point estimate commands include: Draw MarkerMarker Type,   Marker Halo,   Marker Height,   Marker Transparency Height,   Discrete Scaling,   Continuous Scaling,   Continuous Log Scaling,   Interval Scaling,   Scaled Symbols,   Symbol Legend,   Colour_Legend,   Shade Rectangles,   Outline Rectangles,   Data Labels,   Data Points,   Draw Line,   Data Distance,   Data Meters,   Data Line, and   Data Arrow.


Markers


Draw Marker

This command draws a marker to the output device. This function should be issued between matching Objstart, Objend function calls to add the marker to a plotted object. This function returns no result. The current marker_type and marker_height will be used.

There are 2 parameters:
x position NDC's - the x axis coord. in Normalized Device coord. units.
y position NDC's - the y axis coord. in Normalized Device coord. units.

draw_marker(x position NDC's,y position NDC's);

objstart("my data");
draw_marker(mm(50),cm(5 * 3));
draw_marker(xuser(-67.5), yuser(42.3));
objend("my data");

Marker Type

This command allows the user to specify the marker type used when drawing the data points with either the Data Points command or the Scaled Symbols command.

There are 2 parameters:
marker type - The current marker types are:
0 » solid circle, 1 » solid square, 2 » hollow circle, 3 » hollow square,
4 » plus (+) sign, 5 » user-defined marker, 6 » Pict File contains marker drawing.
file name - the optional name of the Pict file to draw as the Marker when the marker type is 6.
A user-defined marker (type 5) requires that the user define a function "Marker (x,y,size)" before plotting the data points. This permits any shape to be used as the marker symbol.

Marker_Type(marker type[,"file name"]);

Marker_Type(0);

initial program state - solid circle

See the example Data Points and Labels


Marker Halo

This command allows the user to specify the width of the white halo draw around the circle and square markers.

There is 1 parameter:
halo width - the width of the marker halo in NDC's.

Marker_Halo(width NDC's);

Marker_Halo(mm(0.1));

initial program state - 0.01 inches


Marker Height

This command allows the user to specify the height of markers. This value is used when plotting data using the Data_Points() and Draw_Marker() commands. This value is ignored (and left unaltered), when plotting scaled symbols.

There is 1 parameter:
height - the height of a marker in NDC's.

Marker_Height(height NDC's);

Marker_Height(mm(2.0));

initial program state - 1 mm. markers

See the example Data Points and Labels


Marker Transparency Height

This command allows the user to specify the height of markers at which point they become transparent (outlined only). This value is used when plotting data using the Data_Points() and Draw_Marker() commands.

There is 1 parameter:
height - the height of a marker when transparency is invoked in NDC's.

Marker_Transparency_Height(height NDC's);

Marker_Transparency_Height(cm(2.0));

initial program state - 1 cm. limit for transparent markers


Scaled Symbols


Discrete Scaling

Defines the parameters required to plot discretely scaled symbols (using a constant log ratio).

When plotting the data, the discrete symbol size to be used is calculated as:

Discrete Symbol

Discrete Symbol

Each data point will be respresented by the appropriate discrete (or fixed) interval into which its z data value falls.

There are 7 parameters:
0 marker - data marker used to represent the zero data values.
non 0 marker - data marker used to represent the non-zero data values.
min symbol size - minimum size (in NDC's) of the symbol used to represent the data on the plot (the size of data points that have a z value of "min data").
max symbol size - maximum size (in NDC's) of the symbol used to represent the data on the plot (the size of data points that have a z value of "max data").
min data - value in user units of the z axis data which is represented by the minimum sized symbol. This value must be greater than 0.
max data - value in user units of the z axis data which is represented by the maximum sized symbol.
Intervals - number of discrete intervals or groups into which the data will be partitioned.

Discrete_Scaling(0 marker,non 0 marker,min symbol size,max symbol size,min data,max data,intervals);

Discrete_Scaling(2, 0, mm(1), mm(5.0), 0.1,1000,4);
Scaled_Symbols();

initial program state - symbol scaling undefined

See the example Discrete Symbols


Continuous Scaling

Defines the parameters required to plot continuously scaled symbols (using a constant log ratio). Each data point will be scaled to exactly represent the z data value, scaled implicitly by the data range and symbol size range.

There are at least 7 parameters:
0 marker - data marker used to represent the zero data values.
non 0 marker - data marker used to represent the non-zero data values.
min symbol size - minimum size (in NDC's) of the symbol used to represent the data on the plot (the size of data points that have a z value of "min data").
max symbol size - maximum size (in NDC's) of the symbol used to represent the data on the plot (the size of data points that have a z value of "max data").
min data - value in user units of the z axis data which is represented by the minimum sized symbol. This value must be greater than 0.
max data - value in user units of the z axis data which is represented by the maximum sized symbol.
Legend values - the actual user data values to be used when drawing a legend.
Note that if your data values are actually outside the range of the min and max data parameters, then they will be scaled appropriately smaller or larger than these established sizes.

Continuous_Scaling(0 marker,non 0 marker,min symbol size,max symbol size,umin data,max data,legend values...);

Continuous_Scaling(2, 0, mm(1), mm(5.0), 0.1, 1000, 0.1, 1, 100, 1000);
Scaled_Symbols();

initial program state - symbol scaling undefined

See the example Continuous Symbols


Continuous Log Scaling

Defines the parameters required to plot continuously scaled symbols (using a log10 scaling). Each data point will be scaled to exactly represent the z data value, scaled implicitly by the data range and symbol size range. In comparison with the Continuous_Scaling() command, this emphases the significance of small values in comparison with the large Z values.

There are at least 7 parameters:
0 marker - data marker used to represent the zero data values.
non 0 marker - data marker used to represent the non-zero data values.
min symbol size - minimum size (in NDC's) of the symbol used to represent the data on the plot (the size of data points that have a z value of "min data").
max symbol size - maximum size (in NDC's) of the symbol used to represent the data on the plot (the size of data points that have a z value of "max data").
min data - value in user units of the z axis data which is represented by the minimum sized symbol. This value must be greater than 0.
max data - value in user units of the z axis data which is represented by the maximum sized symbol.
Legend values - the actual user data values to be used when drawing a legend.

Continous_Log_Scaling(0 marker,non 0 marker,min symbol size,max symbol size,umin data,max data,legend values...);

Continuous_Log_Scaling(2, 0, mm(1), mm(5.0), 0.1, 1000, 0.1, 1, 100, 1000);
Scaled_Symbols();

initial program state - symbol scaling undefined


Interval Scaling

Defines the parameters required to plot discretely scaled symbols. Each data point will be scaled to represent the z data value, scaled implicitly by the data range and symbol size range.

There are at least 4 parameters:
0 marker - data marker used to represent the zero data values.
non 0 marker - data marker used to represent the non-zero data values.
data value - lower limit of a data interval in user units of the z axis data which is represented by the corresponding sized symbol.
symbol size - size (in mm or other units) of the symbol used to represent the data interval on the plot. Two or more intervals must be specified.

Each of the data values (and symbol sizes) are used when drawing a legend.

Interval_Scaling(0 marker,non 0 marker,[data value,symbol size]...);

Interval_Scaling(2, 0, 1, mm(1), 10, mm(2), 50, mm(3), 100, mm(4), 1000, mm(5));
Scaled_Symbols();

initial program state - symbol scaling undefined

See the example Interval Symbols


Scaled Symbols

This command draws the data points (if they have been read into memory) as scaled symbols. The actual size and scaling is determined by the scaling parameters in effect (see Discrete Scaling, Continuous Scaling, Interval Scaling).

Parameters:
xyz matrix - a matrix containing the x, y, and z data as 3 columns. If a data matrix is supplied with more than 3 columns, the 3rd and subsequent columns are treated as independent z values and are plotted as scaled symbol pie charts.
or
x, y, and z vectors - 3 vectors containing the data to be plotted.
colour names matrix - an optional character matrix containing the colour names used to colour (fill) each corresponding scaled symbol.
The default is the current filling colour.
When Pie Charts are generated (from 4+ columns of data), the name of matrix of colour names may be supplied (for each column of z data).

Scaled_Symbols(xyz matrix,colour names matrix);
Scaled_Symbols(z vector,y vector,z vector);

Scaled_Symbols(matrix);
Scaled_Symbols(z,y,z);
x = -65 -64 -63.
y = 43 44 45.
z = 10 20 30.
colours = strfold("RED GREEN BLUE");
Scaled_Symbols(x,y,z,colours);

See the examples Continuous Symbols, Discrete Symbols, Interval Symbols, Multiple Plots.

An example of Pie Charts

GIF_Output("C:/AconOutput/ ScaledSymbolPieCharts.gif", 360, 210);
Function Mappath(x) {return(cat("C:\ Acon\ overlays\ ",x))};
Data_Window(-64.0, -56., 44., 48.0);
Data_Viewport(mm(15.), mm(125.), mm(5.), mm(70.));
Data_Projection("Mercator");
Overlay_File(MapPath("Coast1"));
Overlay_File(MapPath("Depthm200"));
Character_Height(pts(10.));
Axis(2.,1.,1.,0.5,1,0,1,0,0);
tcr = shape(1 6, -60. 45. 2. 2. 2. 2);
tcr = cat(1,tcr, -60. 45.5 1 2 3 4);
tcr = cat(1,tcr, -59. 45 2 4 6 3);
tcr = cat(1,tcr, -59. 45.5 6 0 0 0);
tcr = cat(1,tcr, -59. 46 0 0 6 0)
Line_Colour("Black");
colours = strfold("red blue green yellow");
Continuous_Scaling(1, 0, mm(1.), mm(8), 0.1, 15., 1 5 15.)
Scaled_symbols(tcr,colours)
Colour_Legend(mm(20), mm(60), colours, strfold("Cod Haddock Plaice Herring"));
Symbol_Legend(mm(100), mm(60));
Screen_Output

Scaled Symbol Pie Charts


Symbol Legend

This command draws a symbol legend to label scaled symbols by specifying the position of the legend on the page. The actual size and scaling is determined by the scaling commands (see Discrete Scaling, Continuous Scaling, Interval Scaling). The format of the legend drawn depends on the type of scaling.

There are 2 or more parameters:
x position - the x axis position of the upper left hand corner of the legend in NDC's.
y position - the y axis position of the upper left hand corner of the legend in NDC's.
optional zero legend flag - indicates whether to explictly hide (0) or include (1) the zero data label
(default - show the zero label if the previous Scaled_symbols() command drew 0 data values).
optional background colour name - the name of a previously defined colour used to fill in the background under the legend (default "WHITE").
optional text colour name - the name of a previously defined colour used to draw the text labels (default "BLACK").

Symbol_Legend(x position NDC's,y position NDC's[,zero legend flag][,"background colour"[,"text colour"]]);

Symbol_Legend(mm(150),mm(250));
Symbol_Legend(xuser(-67.5),yuser(45.0));

See the examples Continuous Symbols, Discrete Symbols, Interval Symbols.


Colour Legend

This command draws a colour legend to label colours used in a graphic with specific labels. The legend is created by specifying the position of the legend on the page, the character matrix containing the colours to appear in the legend, and the character matrix containing the text labels to be associated with each colour. The size of the resultant legend is determined by the character height and the number of labels. This command is useful for labelling the data associated with pie charts generated with the Scaled_Symbols() command.

There are 4 parameters:
x position - the x axis position of the upper left hand corner of the legend in NDC's.
y position - the y axis position of the upper left hand corner of the legend in NDC's.
colour matrix - the character matrix containing the colours to appear in the legend.
label matrix - the character matrix containing the text labels to be associated with each colour.

Colour_Legend(x position NDC's,y position NDC's,colour matrix name,label matrix name);

/* create a colour legend */
colours = strfold("red blue green yellow");
Colour_Legend(mm(150), mm(250) ,colours, strfold("Cod Haddock Plaice Herring"));

Colour Legend


Regularly Spaced Data


Shade Rectangles

This command is used to plot the data as shaded rectangles by specifying the cell size of the unit area to shade a rectangle centered on each of the data points. This plot is most likely useful when the data have been aggregated (see the Aggregate Cmd), likely resulting in fewer data points, all aligned to the center of unit rectangles. The x,y coordinates are assumed to be the center of the rectangles so that the rectangle extends 1/2 of the rectangle width on either side of the center point. The current z value is used to look up the corresponding grey value to be used from the Data Contour Levels command. All z values which are less than the data contour minimum z value are ignored (not shaded). All z values which are greater than the data contour maximum z value are shaded using the grey value corresponding to the maximum z value (this action is similar to the Shade Contours command).

Note that the old syntax of Aggregate() adjusted the coordinates with an offset to the center of the aggregation cell. The new syntax version of the Aggregate() returns the min value of the aggregation cell as the new values. If the new syntax version of Aggregate() is used, you must add the 1/2 cell width offset to the aggregated coordinates before using aggregated data with Shade_Rectangles.

There are 2 parameters:
x axis cell width - the width of the cell to shade in NDC's.
y axis cell height - the height of the cell to shade in NDC's.
There are additional parameters:
xyz matrix - a matrix containing the x, y, and z data as 3 columns.
or
x, y, and z vectors - 3 vectors containing the data to be plotted.

Shade_Rectangles(x axis cell width,y axis cell width,xyz matrix);
Shade_Rectangles(x axis cell width,y axis cell width,x vector, y vector, z vector);

Shade_Rectangles(0.5,0.5,mymatrix);
Shade_Rectangles(0.5,0.5,x,y,zv);

See the example Aggregated Shading.


Outline Rectangles

This command is used to plot the borders of the data set as delimited by unit rectangles. This plot is most likely useful when the data have been aggregated, likely resulting in fewer data points, all aligned to the center of unit rectangles. The user may specify whether only the "outside" edges (those which do not share an edge with any other rectangle) are plotted, or alternately all four edges bounding each rectangle are plotted.

There are 3 parameters:
x axis cell width - the width of the cell to shade in NDC's.
y axis cell height - the height of the cell to shade in NDC's.
outline set - 0 » only the "outside" edges (those which do not share an edge with any other rectangle) are plotted,
1 » all four edges bounding each rectangle are plotted.
There are additional parameters:
xyz matrix - a matrix containing the x, y, and z data as 3 columns.
or
x, y, and z vectors - 3 vectors containing the data to be plotted.

Outline_Rectangles(x cell width,y cell width,outline set,matrix);

Outline_Rectangles(x cell width,y cell width,outline set,x vector,y vector,z vector);

Outline_Rectangles(0.5, 0.5, 0, mymatrix);
Outline_Rectangles(0.5,0.5,0,xv,yv,zv);

See the example Aggregated Shading.


Data Labels

This command labels the data points with the numeric value of the points, or with the corresponding character matrix.

Parameters:
xyz matrix - a matrix containing the x, y, and z data as 3 columns.
or
x, y, and z vectors - 3 vectors containing the data to be plotted.
or
x, y vectors or matrix - x,y coordinates to be plotted.
cmat - character matrix of text to be plotted (containing the same number of rows as there are coordinates in x,y).
colourmat - optional character matrix of the names of the colours to be used when plotting (containing the same number of rows as there are coordinates in x,y).

Data_Labels(xyz matrix);
Data_Labels(x vector,y vector,z vector);
Data_Labels(xy matrix, char matrix);
Data_Labels(x vector,y vector,char matrix);

x = -62 -61 -60 -61.
y = 43 44 45 45;
data_labels(x,y,seq(1,4))
s = strfold("this is a test")
data_labels(x,y,s)

See the example Data Points and Labels


Data Points

This command draws the data points using the current marker type at the current marker height on the current output device.

Parameters:
xyz matrix - a matrix containing the x, y, and z data as 3 columns.
or
x, y, and z vectors - 3 vectors containing the data to be plotted.
colour names matrix - an optional character matrix containing the colour names used to colour (fill) each corresponding marker. The default is the current filling colour.

Data_Points(xyz matrix[,colour name matrix]);
Data_Points(x vector,y vector,z vector[,colour name matrix]);

Data_Points(mat);
Data_Points(xv,yv,zv);

See the example Data Points and Labels


Draw Line

This command allows the user to specify the coordinates of a line to be drawn on the output device. The x,y coordinate pairs of the consecutive points of the vector are specified in NDC's. The Data_Line() command may also be used to draw lines, the difference being that this command accepts data in NDCs, while Data_Line() accepts data in user units.

There are 1 or more pairs of parameters:
x value - the x axis coordinate to draw in NDC's.
y value - the y axis coordinate to draw in NDC's.

Draw_Line(x position NDC's,y position NDC's,...)

Draw_Line(xuser(-65.5), yuser(45.5), xuser(-68), yuser(44 + (20 / 60.0)));
Draw_Line(mm(100), mm(100), inches(4.5), mm(150));

See the example VonB Curves


Data Distance

This command is used to calculate the distance and bearing of x,y data points from a reference coordinate (given in user coordinates). If the Projection is Mercator, the distances are calculated using a spheroid model of the earth and converted to km. Optionally, the inverse operation may be performed; that is, return the x,y data points a given distance and bearing from a reference coordinate(s). The data must already be in memory before this command will execute.

There are 5 parameters:
x reference - the x axis reference point in user units.
y reference - the y axis reference point in user units.
x data - the x axis data for which a distance is required (optionally this may contain distances)
y data - the y axis data for which a distance is required (optionally this may contain bearings)
alternately a matrix of 4 columns containing x,y, x,y coordinates may be supplied
distance bearing flag - optional flag to indicate that distance and bearings are being supplied in the x data and y data, and that x,y coordinates should be returned.

xymat = Data_Distance(x reference,y reference, x data, y data);
xymat = Data_Distance(x1 y1 x2 y2 data matrix);

data_projection("NIL");
Data_distance(-64,48,-63,48);
1 90
Data_distance(-64,48,1,90,1);
-63 48
data_projection("MERCATOR");
da = Data_distance(-64.,48.,-63.,48.);
print(da)
74.624439 90
xy = Data_distance(-64.,48.,da[1;1],-90,1);
print(xy);
-65 48
Data_distance(-64.,48.,xy[1;1],xy[1;2]);
74.624439 270

Data Metres

This command is used to calculate the eastings and northings of x,y data points for a given projection (given in user coordinates). A valid projection should be established before issuing this command.

There are 2 parameters:
x data - the x axis data for which a distance is required
y data - the y axis data for which a distance is required alternately a matrix of 2 columns containing x,y coordinates may be supplied

xymat = Data_Metres(x data, y data);
xymat = Data_Metres(x y data matrix);

Data_Projection(\"proj=UTM zone=19 ellps=clrk66\");
Data_metres(-63,48);
947501.283761 5333524.418283

Data Line

This command draws a line between the data points in their order of occurrence. The Draw_Line() command may also be used to draw lines, the difference being that this command accepts data in user units while Draw_Line() accepts data in NDCs, .

Typically this can be used for drawing a line graph using a NIL projection, or a cruise track using a Mercator projection.

Parameters:
xyz matrix - a matrix containing the x, y, and z data as 3 columns.
or
x, y, and z vectors - 3 vectors containing the data to be plotted.

Data_Line(xyz matrix);
Data_Line(x vector,y vector,z vector);

Data_Line(mat); Data_Line(xv,yv,zv);

See the examples CruiseTracks, VonB Curves.


Data Arrow

This command draws arrows between pairs of data points in user units. The Arrow() command may also be used to draw arrows (in NDC units).

Parameters:
xyxy matrix - a matrix containing the x, y starting coordinates and x,y ending coordinates as 4 columns.
or
xs, ys, xe, ye vectors - 4 vectors containing the x, y starting coordinates and x,y ending coordinates to be plotted.
linewidth - the optional line width of the arrows in NDC units.
If this value is negative a stroked line is drawn, otherwise a filled arrow will be drawn.
arrowhead length - the optional length of the arrow head relative to the current line width. The default value is 3x.
arrowhead width - the optional width of the arrow head relative to the current line width. The default value is 2x.

Data_Arrow(xyxy matrix [, linewidth, head length, head width]);
Data_Line(x vector,y vector,x vector,y vector [,linewidth, head length, head width]);

Data_Arrow(mat);
Data_Arrow(xv,yv,xev,yev,pts(0.25),3,2);

See the examples Filled Arrows.


AconIcon ACON       Home/Topics   |   Commands



Last Modified : 2003-11-19