This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Built-in Functions / Graphics and Sound / Graphics Primitives  /
Text

  • Text[ expr , coords ] is a graphics primitive that represents text corresponding to the printed form of expr, centered at the point specified by coords.
  • The text is printed by default in OutputForm.
  • Text can be used in both two- and three-dimensional graphics.
  • The coordinates can be specified either as x , y , ... or as Scaled[ x , y , ... ].
  • In two dimensions, coordinates can also be specified using Offset.
  • Text[ expr , coords , offset ] specifies an offset for the block of text relative to the coordinates given. Giving an offset sdx , sdy specifies that the point x , y should lie at relative coordinates sdx , sdy within the bounding rectangle that encloses the text. Each relative coordinate runs from -1 to +1 across the bounding rectangle.
  • The offsets specified need not be in the range to .
  • Here are sample offsets to use in two-dimensional graphics:
  • Text[ expr , coords , offset , dir ] specifies the orientation of the text is given by the direction vector dir. Possible values of dir are:
  • Text in three-dimensional graphics is placed at a position that corresponds to the projection of the point x , y , z specified. Text is drawn in front of all other objects.
  • The font or style for text can be specified using StyleForm or using the TextStyle option. If no such specifications are given, the font is determined from the setting for TextStyle for the whole plot, which is in turn by default given by the global variable $TextStyle.
  • You can specify the color of text using CMYKColor, GrayLevel, Hue and RGBColor directives.
  • The option CharacterEncoding for Display can be used to specify what raw character encoding to use for character strings in Text objects.
  • The following options can be given:
  • See the Mathematica book: Section 2.9.2Section 2.9.16.
  • See also: PlotLabel, AxesLabel, Cell.

    Further Examples

    This illustrates how to position text in graphics.

    Evaluate the cell to see the graphic.

    In[1]:=