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

Text


The Text commands include: Draw Text, Character Alignment, Character Height, Character Rotation, and Decimal Digits.


Draw Text

This command allows the user to draw a text string on the plot. The x,y coordinate point of the lower left corner of the text, and the text itself, are specified.

The are 3 or more parameters:
x position- x axis coordinate in NDC units.
y position- y axis coordinate in NDC units.
text string - the text string to be drawn.
alternately x position and y position may be vectors, and text string a character matrix
colour matrix - optional matrix of colour names to be used to colour each of the text strings

Draw_Text(x position NDC´s,y position NDC´s,"text string"[,colour name matrix]);

Draw_Text(mm(150),mm(250),"My text string");
Draw_Text(xuser(-67.5),yuser(45.0),"Plot showing 1979 Scallop Catches");
draw_text(mm(20),mm(260),"blue",strfold("blue"))
draw_text(mm(20),mm(250),strfold("blue red green"),strfold("blue red green"))
draw_text(mm(60 70 80),mm(240 240 240),strfold("blue red green"),strfold("blue red green"))

See the example Data Points and Labels


Character Alignment

This command allows the user to specify the character alignment of subsequently drawn characters.

There is 1 parameter:
alignment - horizontal character alignment (0 = left, 1 = centered, 2 = right).

Character_Alignment(alignment)

Character_Alignment(0);

initial program state - left justified


Character Height

This command allows the user to specify the height of subsequently drawn characters. The current character height (in NDCs) is stored in the built-in variable @character_height.

There is 1 parameter:
height - character height in NDC units.

Character_Height(height NDC´s);

Character_Height(pts(12));

initial program state - 12 pt text

See the example Data Points and Labels


Character Rotation

This command allows the user to make the drawn characters rotate at a given angle.

Note: PostScript_Output does not support Character_Rotation.
There is 1 parameter:
degree - degree of the angle that the character is supposed to rotate at. The default for this argument is 0.

Character_rotation(degree);

Character_rotation(180); Draw_Text(mm(150),mm(250),"My text string");

Decimal Digits

This command allows the user to specify the number of decimal digits to be used when drawing numbers in subsequently drawn text. These are used in the Axis(), and Data_Labels() commands.

There is 1 parameter:
digits - the number of decimal digits to be plotted.

Decimal_Digits(digits);

Decimal_Digits(1);

initial program state - no decimal digits

See the example Data Points and Labels


AconIcon ACON       Home/Topics   |   Commands



Last Modified : 2003-11-19