Controlling the Appearance of Sub-strings

Normally, each string of characters displayed using a PlotPlot will be plotted so that all characters in the string have the same font size, colour, etc., specified by the appropriate attributes of the Plot. However, it is possible to include escape sequences within the text to modify the appearance of sub-strings. EscapeEscape sequences can be used to change, colour, font, size, width, to introduce extra horizontal space between characters, and to change the base line of characters (thus allowing super-scripts and sub-scripts to be created). See the entry for the Escape attribute in Appendix C for details.

As an example, if the character string “10\%^50%s70+0.5+” is plotted, it will be displayed as “$10^{0.5}$” - that is, with a super-scripted exponent. The exponent text will be 70% of the size of normal text (as determined by the Size attribute), and its baseline will be raised by 50% of the height of a normal character.

Such escape sequences can be used in the strings assigned to textual attributes of the Plot (such as the axis Labels), and may also be included in strings plotted using astTextastText.

The Format attribute for the SkyAxisSkyAxis class includes the “g” option which will cause escape sequences to be included when formatting celestial positions so that super-script characters are used as delimiters for the various fields (a super-script “h” for hours, “m” for minutes, etc).

Note, the facility for interpreting escape sequences is only available if the graphics wrapper functions which provide the interface to the underlying graphics system support all the functions included in the grf.h file as of AST V3.2. Older grf interfaces may need to be extended by the addition of new functions before escape sequences can be interpretted.