({{, (RefLink[Text, paclet:ref/Text])[expr]
displays with expr in plain text format. }, {, (RefLink[Text, paclet:ref/Text])[expr,coords]
is a graphics primitive that displays the textual form of expr centered at the point specified by coords. }})

OpenersNotesSection(Spacer1)Details and Options

The text is displayed by default in (RefLink[StandardForm, paclet:ref/StandardForm]), but in a typical textual font such as Arial or Helvetica.

(RefLink[Text, paclet:ref/Text]) can be used in both two- and three-dimensional graphics.

In graphics, (RefLink[Text, paclet:ref/Text])[expr] is equivalent to (RefLink[Text, paclet:ref/Text])[expr,{0,0}] or (RefLink[Text, paclet:ref/Text])[expr,{0,0,0}].

(RefLink[Text, paclet:ref/Text])[expr,coords] works like (RefLink[Inset, paclet:ref/Inset])[expr,coords].

The coordinates can be specified either as {x,y,…} or as (RefLink[Scaled, paclet:ref/Scaled])[{x,y,…}]. »

In two dimensions, coordinates can also be specified using (RefLink[Offset, paclet:ref/Offset]). »

(RefLink[Text, paclet:ref/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 -1 to +1.

Sample offsets to use in two-dimensional graphics include:

(RefLink[Text, paclet:ref/Text])[expr,coords,offset,dir] specifies the orientation of the text and 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 following options can be given:

Outside of graphics, (RefLink[Text, paclet:ref/Text])[expr] effectively generates a (RefLink[TextCell, paclet:ref/TextCell]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (19)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Display an expression in plain text format:

Text[x^2+2x+1==0]

Display text in 2D graphics:

Graphics[{Circle[],Text[x^2+y^2<1,{0,0}]}]

Display text in 3D graphics:

Graphics3D[{Sphere[],Text[x^2+y^2+z^2<1,{0,0,0}]}]

OpenersExampleSection1(Spacer1)Scope  (10)

OpenersExampleSubsection0(Spacer1)Positions  (6)

By default, (RefLink[Center, paclet:ref/Center]) is used for the position of the text in 2D:

{Graphics[{Text["ABCDEF"],Circle[]},Axes->True,Ticks->None],
Graphics[{Text["ABCDEF",Center],Circle[]},Axes->True,Ticks->None]}

(RefLink[Automatic, paclet:ref/Automatic]) is equivalent to (RefLink[Center, paclet:ref/Center]):

Graphics[{Text["ABCDEF",Automatic],Circle[]},Axes->True,Ticks->None]

Specify ordinary coordinates in a graphic:

Graphics[{Text[2Pi r,{.5,.5}],Circle[]},Frame->True]

Graphics3D[{Text[4Pi r^2,{0,.5,.5}],Sphere[]},Axes->True]

Use (RefLink[Scaled, paclet:ref/Scaled]) coordinates:

Graphics[{Text[Pi r^2,Scaled[{.5,.5}]],Circle[]}]

Graphics3D[{Text[a^3,Scaled[{.5,.5,1}]],Cuboid[]}]

(RefLink[ImageScaled, paclet:ref/ImageScaled]) specifies coordinates in a whole image, including padding:

Framed@Graphics[{Text[x^2+y^2==1,ImageScaled[{.5,.5}]],Circle[]},ImagePadding->{{0,50},{0,0}}]

Use (RefLink[Offset, paclet:ref/Offset]) coordinates in 2D:

Graphics[{Text[Pi r^2,Offset[{10,20},{0,0}]],Circle[]}]

Symbolic positions can be specified:

Table[Graphics[{Text["ABCDEF",{s,Center}],Circle[]}],{s,{Left,Center,Right}}]

Table[Graphics[{Text["ABCDEF",{Center,s}],Circle[]}],{s,{Top,Center,Bottom}}]

OpenersExampleSubsection1(Spacer1)Offsets and Directions  (4)

By default, (RefLink[Center, paclet:ref/Center]) is used for the alignment position:

{Graphics[{Text["ABCDEF",{0,.5}],Circle[]},Axes->True,Ticks->None],
Graphics[{Text["ABCDEF",{0,.5},Center],Circle[]},Axes->True,Ticks->None]}

(RefLink[Automatic, paclet:ref/Automatic]) is equivalent to (RefLink[Center, paclet:ref/Center]):

Graphics[{Text["ABCDEF",{0,.5},Automatic],Circle[]},Axes->True,Ticks->None]

Specify an alignment position within the text, using symbolic positions:

Table[Graphics[{Text["ABCDEF",{0,0},{p,Center}],Circle[]},Axes->{False,True},Ticks->None],{p,{Right,Center,Left}}]

Table[Graphics[{Text["ABCDEF",{0,0},{Center,p}],Circle[]},Axes->{True,False},Ticks->None],{p,{Top,Center,Bottom}}]

Specify the offsets using -1, 1 coordinates within the text:

Table[Graphics[{Text["ABCDEF",{0,0},a],Circle[]},Axes->True,Ticks->None],{a,{{1,1},{-1,1},{-1,-1},{1,-1}}}]

Table[Graphics3D[{Text["ABCDEF",{0,0,0},a],Sphere[]}],{a,{{1,1},{-1,1},{-1,-1},{1,-1}}}]

Specify the orientation of text using a vector:

Table[Graphics[{Text[Style[x^2+y^2<1,Medium],{0,0},Automatic,d],Circle[]}],{d,{{1,0},{1,1},{0,1},{-1,-1}}}]

OpenersExampleSection2(Spacer1)Options  (3)

OpenersExampleSubsection2(Spacer1)Background  (1)

Specify the background color:

Graphics[{Text[x^2+y^2<1,Background->LightRed],Circle[]}]

OpenersExampleSubsection3(Spacer1)FormatType  (2)

By default, expressions are displayed using (RefLink[TraditionalForm, paclet:ref/TraditionalForm]):

Graphics[{Text[Style[x^2+y^2<1,Medium]],Circle[]}]

Display expressions using (RefLink[StandardForm, paclet:ref/StandardForm]):

Graphics[{Text[Style[x^2+y^2<1,Medium],FormatType->StandardForm],Circle[]}]

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

The symbolic positions are relative to (RefLink[ImageScaled, paclet:ref/ImageScaled]) coordinates:

Table[Framed@Graphics[{Text["ABCDEF",{s,Center}],Circle[]},ImagePadding->{{10,40},{0,0}}],{s,{Left,Center,Right}}]

Table[Framed@Graphics[{Text["ABCDEF",{Center,s}],Circle[]},ImagePadding->{{0,0},{10,20}}],{s,{Top,Center,Bottom}}]

Text styles can be specified by using (RefLink[Style, paclet:ref/Style]):

Graphics[{Text[Style["ABCDEF",Large,Bold,Red],{0,0},Automatic,{2,1}],Circle[]}]

OpenersExampleSection4(Spacer1)Neat Examples  (1)

A random collage of text:

Graphics[Table[Text[Style["Mathematica",Hue[RandomReal[]],Italic,RandomInteger[{10,30}]],RandomReal[1,{2}],Automatic,RandomReal[{-1,1},{2}]],{20}],AspectRatio->1/GoldenRatio,ImageSize->300]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Inset, paclet:ref/Inset])  ▪  (RefLink[TextCell, paclet:ref/TextCell])  ▪  (RefLink[Row, paclet:ref/Row])  ▪  (RefLink[TextGrid, paclet:ref/TextGrid])  ▪  (RefLink[PlotLabel, paclet:ref/PlotLabel])  ▪  (RefLink[AxesLabel, paclet:ref/AxesLabel])  ▪  (RefLink[Cell, paclet:ref/Cell])  ▪  (RefLink[Rotate, paclet:ref/Rotate])  ▪  (RefLink[TextRecognize, paclet:ref/TextRecognize])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Three-Dimensional Graphics Primitives, paclet:tutorial/ThreeDimensionalGraphicsPrimitives])}, {▪(RefLinkPlain[Formatted Output, paclet:tutorial/FormattedOutput])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Mathematical Typesetting, paclet:guide/MathematicalTypesetting])}, {▪(RefLinkPlain[Maps & Cartography, paclet:guide/MapsAndCartography])}, {▪(RefLinkPlain[Options & Styling for Interactive Manipulation, paclet:guide/OptionsAndStylingForInteractiveManipulation])}, {▪(RefLinkPlain[Notebook Document Generation, paclet:guide/DocumentGeneration])}, {▪(RefLinkPlain[Textual Elements in Notebooks, paclet:guide/TextualElementsInNotebooks])}, {▪(RefLinkPlain[Chart Labeling, Legending & Annotation, paclet:guide/ChartLabelingLegendingAndAnnotation])}, {▪(RefLinkPlain[Labels, paclet:guide/Labels])}, {▪(RefLinkPlain[Graphics Annotation & Appearance, paclet:guide/GraphicsAnnotationAndAppearance])}, {▪(RefLinkPlain[Creating Form Interfaces & Apps, paclet:guide/CreatingFormsAndApps])}, {▪(RefLinkPlain[Standalone Interfaces, paclet:guide/StandAloneInterfaces])}, {▪(RefLinkPlain[Symbolic Graphics Language, paclet:guide/SymbolicGraphicsLanguage])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/14-coordinates-and-graphics.html])(WebLink[: Coordinates and Graphics, https://www.wolfram.com/language/elementary-introduction/14-coordinates-and-graphics.html])}})}})