Using a PlotPlot to draw text involves supplying a string of text to be displayed and a position in physical coordinates where the text is to appear. The position is transformed into graphical coordinates to determine where the text should appear on the plotting surface. You must also provide a 2-element “up” vector which gives the upward direction of the text in graphical coordinates. This allows text to be drawn at any angle.
Plotting is performed by astTextastText, for example:
Here, “text” contains the string to be drawn, “pos” is an array of physical coordinates and “up” specifies the upward vector. In this case, the text will be drawn horizontally. The final argument specifies the text justification, here indicating that the top left corner of the text should appear at the position given.
Further control over the appearance of the text is possible by setting values for various Plot attributes, for example Colour, Font and Size. Sub-strings within the displayed text can be given different appearances, or turned into super-scripts or sub-scripts, by the inclusion of escape sequences (see section ยง21.13) within the supplied text string.