Inset[obj]
represents an object obj inset in a graphic.
Inset[obj,pos]
specifies that the inset should be placed at position pos in the graphic.
Inset[obj,pos,opos]
aligns the inset so that position opos in the object lies at position pos in the enclosing graphic.
Inset[obj,pos,opos,size]
specifies the size of the inset in the coordinate system of the enclosing graphic.
Inset[obj,pos,opos,size,dirs]
specifies that the axes of the inset should be oriented in directions dirs.
Inset
Inset[obj]
represents an object obj inset in a graphic.
Inset[obj,pos]
specifies that the inset should be placed at position pos in the graphic.
Inset[obj,pos,opos]
aligns the inset so that position opos in the object lies at position pos in the enclosing graphic.
Inset[obj,pos,opos,size]
specifies the size of the inset in the coordinate system of the enclosing graphic.
Inset[obj,pos,opos,size,dirs]
specifies that the axes of the inset should be oriented in directions dirs.
Details and Options
- Inset can be used in Graphics and Graphics3D.
- In interactive manipulation, Inset[obj,…] is by default selected as a single unit. A double‐click is required to select individual elements inside.
- The object obj can be a graphic, cell expression, string, or any other expression.
- An object inset in Graphics3D is displayed as a billboard while the 3D graphic is rotated.
- Positions can be specified by:
-
{x,y} ordinary coordinates in a plot Scaled[{x,y},…] scaled coordinates from 0 to 1 ImageScaled[{x,y},…] scaled coordinates from 0 to 1 across a whole image Offset[{dx,dy},…] absolute offset in printer's points Center, etc. {Center,Center}, etc. {valx,valy,valz} coordinates in a 3D graphic
coordinates can be numbers, Automatic, or Left, Center, Right, or Axis.
coordinates can be numbers, Automatic, or Top, Center, Bottom, Baseline, or Axis. - Axis corresponds to the position of the axis in a plot or the center line in typeset text.
- Center corresponds to a position centered with respect to the whole image.
- Inset[obj] is equivalent to Inset[obj,Center].
- The default for opos is the setting for the AlignmentPoint option of obj, or by default, the center of the bounding box for obj.
- If size is Automatic, the inset is given at its natural size:
-
graphic determined by ImageSize setting typeset expression absolute size without wrapping - A size of {w,Automatic} specifies that a typeset expression should be wrapped at width w.
- If size is given as {w,h}, then any object obj whose aspect ratio is not fixed will be horizontally or vertically stretched so as to fit exactly in a w×h rectangle.
- If obj is an object with fixed aspect ratio, then blank space will be left equally on both sides if there is a direction where the object would have to be stretched in order to fit exactly.
- The setting for the option Background specifies the background to be used for the whole region of the inset.
- By default, the inset is arranged so that its
and
directions are oriented with the
and
directions of the enclosing graphic. - Inset[…,dirs] can be used to specify different orientations.
- Possible choices for dirs are:
-
Automatic default orientation {xx,xy}
direction along {xx,xy}{Automatic,{yx,yy}}
direction along {yx,yy}{{xx,xy},{yx,yy}}
and
directions along {xx,xy} and {yx,yy}None never reorient the contents of the Inset - Specifying only the
or only the
direction in general leads to a rigid rotation of the inset. - Specifying both the
and
directions in general leads to a rotation and shear, in which the original inset rectangle becomes a parallelogram defined by the vector directions given. - Only the directions of the vectors {xx,xy} and {yx,yy} are significant; the scale of the inset is determined by {w,h}.
- With dirs specified as None, the
direction of obj is always maintained as horizontal. - With dirs specified as {Automatic,None}, the
direction is maintained as vertical. - If Inset[Graphics3D[…],{x,y}] appears in a 2D graphic, then the projection of the alignment point of the Graphics3D, or by default the center of its 2D bounding box, will be placed at position {x,y} in the 2D graphic.
- Inset[Graphics3D[…],{x,y,z},{ox,oy}] specifies that position {ox,oy} in the 2D projection of the object should lie at position {x,y,z}.
- The 2D graphic is always taken to be oriented parallel to the viewing plane for the 3D graphic.
- The following options can be given for Inset:
-
Alignment Left how to align the contents of the inset Background None the background to use for the whole region of the inset BaseStyle {} the base style to use for the inset ContentSelectable Automatic whether to allow contents to be selected FormatType Automatic format type for text - Background->Automatic uses whatever background has been specified for the whole graphic containing the inset.
- Scaled, ImageScaled, and Offset forms can be used to specify the size.
Examples
open all close allBasic Examples (4)
Graphics[{StandardOrange, Disk[], Inset[Plot[Tan[x], {x, -3, 3}]]}]Inset an expression in a graphic:
Graphics[{Circle[], Inset[x ^ 2 + y ^ 2 == 1, {0, 0}]}]Inset 3D graphics above a 2D plot:
Plot[Sin[x], {x, 0, 10}, Epilog -> Inset[Graphics3D[Cylinder[], ImageSize -> 60, Boxed -> False], {0.5, Center}]]Inset a 2D graphic into a 3D graphic:
Graphics3D[{Sphere[{0, -1, 0}, 0.5], Cuboid[{-0.25, 0.5, -0.25}, {0.25, 1, 0.25}], Inset[Graphics[{StandardOrange, Disk[{0, 0}, .25]}, ImageSize -> 50], {0, 0, 0}]}, PlotRange -> 2]Scope (20)
Positions (6)
By default, Center is used for the position:
{Graphics[{Inset["ABCDEF"], Circle[]}, Axes -> True, Ticks -> None],
Graphics[{Inset["ABCDEF", Center], Circle[]}, Axes -> True, Ticks -> None]}Automatic is equivalent to Center:
Graphics[{Inset["ABCDEF", Automatic], Circle[]}, Axes -> True, Ticks -> None]Specify ordinary coordinates in a graphic:
Graphics[{Inset[x ^ 2 + y ^ 2 == 1, {0, .5}], Circle[]}, Frame -> True]Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}], Sphere[]}, Axes -> True]Use Scaled coordinates:
Graphics[{Inset[x ^ 2 + y ^ 2 == 1, Scaled[{.5, .25}]], Circle[]}, Frame -> True]Graphics3D[{Opacity[.5], Inset["ABCDEF", Scaled[{.5, .5, 0.25}]], Sphere[]}, Axes -> True]ImageScaled specifies coordinates in a whole image including padding:
Framed@Graphics[{Inset[x ^ 2 + y ^ 2 == 1, ImageScaled[{.5, .5}]], Circle[]}, ImagePadding -> {{0, 50}, {0, 0}}]Use Offset coordinates:
Graphics[{Inset[x ^ 2 + y ^ 2 == 1, Offset[{10, 20}, {0, 0}]], Circle[]}]Symbolic positions can be specified:
Table[Graphics[{Inset["ABCDEF", {s, Center}], Circle[]}], {s, {Left, Center, Right}}]Table[Graphics[{Inset["ABCDEF", {Center, s}], Circle[]}], {s, {Top, Center, Bottom}}]Alignments (4)
By default, Center is used for the alignment position:
{Graphics[{Inset["ABCDEF", {0, 0}], Circle[]}, Axes -> True, Ticks -> None],
Graphics[{Inset["ABCDEF", {0, 0}, Center], Circle[]}, Axes -> True, Ticks -> None]}Automatic is equivalent to Center:
Graphics[{Inset["ABCDEF", {0, 0}, Automatic], Circle[]}, Axes -> True, Ticks -> None]{Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}], Sphere[]}, Axes -> True], Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}, Automatic], Sphere[]}, Axes -> True], Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}, Center], Sphere[]}, Axes -> True]}Specify an alignment position within the inset, using symbolic positions:
Table[Graphics[{Inset["ABCDEF", {0, 0}, {p, Center}], Circle[]}, Axes -> {False, True}, Ticks -> None], {p, {Right, Center, Left}}]Table[Graphics[{Inset["ABCDEF", {0, 0}, {Center, p}], Circle[]}, Axes -> {True, False}, Ticks -> None], {p, {Top, Center, Bottom}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, {p, Center}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {Right, Center, Left}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, {Center, p}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {Top, Center, Bottom}}]Specify an alignment position using the inset graphics coordinates:
g = Plot[Sin[x], {x, 0, 2Pi}, Ticks -> {{0, Pi, 2Pi}, {-1, 1}}, ImageSize -> 60];Table[Graphics[{Inset[g, Center, {p, 0}], Circle[]}, Axes -> {False, True}, Ticks -> None], {p, {0, Pi, 2Pi}}]Table[Graphics[{Inset[g, Center, {Pi, p}], Circle[]}, Axes -> {True, False}, Ticks -> None], {p, {-1, 0, 1}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, {p, Center}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {0, Pi, 2Pi}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, {Pi, p}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {-1, 0, 1}}]Set the
axis as an alignment position:
g = Plot[Sin[x], {x, 0, 2Pi}, Ticks -> None, AxesOrigin -> {0, 1 / 2}, ImageSize -> 60];Graphics[{Inset[g, Center, {Center, Axis}], Circle[]}, Axes -> True, AxesStyle -> Dashed, Ticks -> None]Sizes (7)
If the size is not given, or is Automatic, the image size of the inset graphic is used:
g = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None, ImageSize -> 50];{Graphics[{Inset[g], Circle[]}, Axes -> True, Ticks -> None], Graphics[{Inset[g, Center, Center, Automatic], Circle[]}, Axes -> True, Ticks -> None]}{Graphics3D[{Inset[g, {0, 0, 0}, Automatic], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], Graphics3D[{Inset[g, {0, 0, 0}, Automatic, Automatic], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True]}For typeset expressions, absolute font size is used:
{Graphics[{Inset[Style["ABCDEF", 10]], Circle[]}], Graphics[{Inset[Style["ABCDEF", 20]], Circle[]}]}Specify the width of the inset by the units of the enclosing graphic:
g = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None];Table[Graphics[{Inset[g, Automatic, Automatic, s], Circle[{0, 0}, 2]}, Frame -> True], {s, {1, 2, 3}}]Specify the width using Scaled values:
Table[Graphics[{Inset[g, Automatic, Automatic, s], Circle[{0, 0}, 2]}, Frame -> True], {s, {Scaled[.25], Scaled[.5], Scaled[.75]}}]Specify the width using Offset values, setting an absolute size in printer's points:
Table[Graphics[{Inset[g, Automatic, Automatic, s], Circle[{0, 0}, 2]}, Frame -> True], {s, {Offset[20], Offset[40], Offset[60]}}]Specify the width and height of the Inset:
Graphics[{Inset["", Automatic, Automatic, {1, 2}, Background -> StandardOrange], Circle[{0, 0}, 2]}, Frame -> True]Scaled width and height:
Graphics[{Inset["", Automatic, Automatic, Scaled[{.3, .8}], Background -> StandardOrange], Circle[{0, 0}, 2]}, Frame -> True]Offset width and height:
Graphics[{Inset["", Automatic, Automatic, Offset[{90, 20}], Background -> StandardOrange], Circle[{0, 0}, 2]}, Frame -> True]When both width and height are specified, graphics may be constrained in one dimension:
g1 = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None];
Graphics[{Inset[g1, Automatic, Automatic, {1.5, .4}, Background -> StandardBrown], Circle[]}]Setting AspectRatioFull causes the graphic to be stretched to fully fill the specified size:
g2 = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None, AspectRatio -> Full];
Graphics[{Inset[g2, Automatic, Automatic, {1.5, .4}, Background -> StandardBrown], Circle[]}]{w,Automatic} specifies the width at which a typeset expression should be wrapped:
t = "abcd xyz abcd xyz abcd xyz abcd xyz abcd xyz";Table[Graphics[{Inset[Framed[t], Automatic, Automatic, {s, Automatic}], Circle[{0, 0}, 2]}, Frame -> True], {s, {2, 4}}]In 3D graphics, image size is specified in absolute values:
g = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None];Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, s], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {s, {30, 60, 90}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, {s, s}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {s, {30, 60, 90}}]Scaled can also be used to specify the image size:
Graphics3D[{Inset[g, {0, 0, 0}, Automatic, Scaled[{.3, .2}]], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True]Directions (3)
Specify the direction with which the
axis of the inset should be aligned:
g = Plot[Sin[x ^ 2], {x, 0, 4}, Axes -> True, Ticks -> None];Table[Graphics[{Inset[g, Automatic, Automatic, 1.5, d], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, 100, d]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics[{Inset["ABCDEF", Automatic, Automatic, Automatic, d], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, Automatic, Automatic, d]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Specify the direction with which the
axis of the inset should be aligned:
g = Plot[Sin[x ^ 2], {x, 0, 4}, Axes -> True, Ticks -> None];Table[Graphics[{Inset[g, Automatic, Automatic, 1.5, {Automatic, d}], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, 100, {Automatic, d}]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics[{Inset["ABCDEF", Automatic, Automatic, Automatic, {Automatic, d}], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, Automatic, Automatic, {Automatic, d}]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Specify the directions for the
and
axes separately:
g = Plot[Sin[x ^ 2], {x, 0, 4}, Axes -> True, Ticks -> None];{Graphics[{Inset[g, Automatic, Automatic, 1.5, {{2, 0}, {1, 2}}], Circle[]}], Graphics3D[{Inset[g, {0, 0, 0}, Automatic, 100, {{2, 0}, {1, 2}}]}]}{Graphics[{Inset[Style["ABCDEF", 20], Automatic, Automatic, Automatic, {{2, 0}, {1, 2}}], Circle[]}], Graphics3D[{Inset[Style["ABCDEF", 20], {0, 0, 0}, Automatic, Automatic, {{2, 0}, {1, 2}}]}]}Generalizations & Extensions (3)
{Graphics[{Inset[Style["ABCDEF", 20], Automatic, Automatic, Automatic, {{-1, 0}, {0, 1}}], Circle[]}], Graphics3D[{Inset[Style["ABCDEF", 20], {0, 0, 0}, Automatic, Automatic, {{-1, 0}, {0, 1}}]}]}{Graphics[{Inset[Style["ABCDEF", 20], Automatic, Automatic, Automatic, {{1, 0}, {0, -1}}], Circle[]}], Graphics3D[{Inset[Style["ABCDEF", 20], {0, 0, 0}, Automatic, Automatic, {{1, 0}, {0, -1}}]}]}control = DynamicModule[{x = 0}, Button[Dynamic[x], x++;EmitSound[Sound[SoundNote[]]]]];
{Graphics[{Circle[], Inset[control, {0, 0}]}], Graphics3D[{Sphere[{0, -1, 0}, 0.5], Inset[control, {0, 0, 0}]}]}Options (7)
Alignment (1)
Background (1)
BaseStyle (2)
{Graphics[{Inset[Style["circle", StandardBlue], BaseStyle -> Directive[Large, Italic]], Circle[]}], Graphics3D[{Inset[Style["circle", StandardBlue], BaseStyle -> Directive[Large, Italic]]}]}{Graphics[{Inset["circle", BaseStyle -> "Title"], Circle[]}], Graphics3D[{Inset["circle", BaseStyle -> "Title"]}]}ContentSelectable (1)
FormatType (2)
By default, expressions are displayed using TraditionalForm:
Graphics[{Inset[Style[x ^ 2 + y ^ 2 < 1, Medium]], Circle[]}]Display expressions using StandardForm:
Graphics[{Inset[Style[x ^ 2 + y ^ 2 < 1, Medium], FormatType -> StandardForm], Circle[]}]Applications (3)
Multiple function plot with a legend:
legendPlot[xl_List, d_, args___] := Plot[xl, d, Epilog -> Inset[Panel[Grid[MapIndexed[{Graphics[{ColorData[97, First@#2], Thick, Line[{{0, 0}, {1, 0}}]}, AspectRatio -> .1, ImageSize -> 20], #1}&, xl]]], Offset[{-2, -2}, Scaled[{1, 1}]], {Right, Top}], args]legendPlot[{Sin[x], Cos[x], Sinc[x]}, {x, 0, 10}]co = {"Austria", "Belgium", "France", "Germany", "Ireland", "Italy", "Luxembourg", "Netherlands", "Portugal", "Spain", "Switzerland", "UnitedKingdom"};Set up an annotation function using Inset:
a[c_] := Inset[Grid[{{c, SpanFromLeft}, {"Pop.", Row[{Round[CountryData[c, "Population"] / 10 ^ 6], " mil."}]}, {"Flag", Show[CountryData[c, "Flag"], ImageSize -> 30]}}, BaseStyle -> Directive[Small, FontFamily -> "Helvetica"], Background -> White, Frame -> All], Reverse@CountryData[c, "CenterCoordinates"]];Display the map with the annotations:
Graphics[{EdgeForm[StandardGray], LightBlue, CountryData[#, "Polygon"]& /@ co, Black, a /@ co}, ImageSize -> 500]Define a stock plot with a legend:
stockPlot[sl_List, {y_, m_}, args___] := DateListPlot[FinancialData[#, {y, m}]& /@ sl, Joined -> True, PlotMarkers -> Automatic, PlotRange -> {All, {0, All}}, PlotStyle -> ColorData[91, "ColorList"], Epilog -> Inset[Panel[Grid[MapIndexed[{Style[{●, ■, ◆}[[First@#2]], ColorData[91, First@#2]], FinancialData[#1, "Name"]}&, sl]]], Offset[{-2, 2}, Scaled[{1, .3}]], {Right, Bottom}], args]Draw stock price changes of a few automakers:
stockPlot[{"F", "TM", "HMC"}, {2007, 3}]Properties & Relations (2)
The symbolic positions are relative to ImageScaled coordinates:
Table[Framed@Graphics[{Inset["ABCDEF", {s, Center}], Circle[]}, ImagePadding -> {{10, 40}, {0, 0}}], {s, {Left, Center, Right}}]Table[Framed@Graphics[{Inset["ABCDEF", {Center, s}], Circle[]}, ImagePadding -> {{0, 0}, {10, 20}}], {s, {Top, Center, Bottom}}]For typeset expressions, Text offers functionality similar to Inset:
Graphics[{Text[x ^ 2 + y ^ 2 == 1, {0, 0}], Circle[]}]Graphics3D[{{DarkGray, Text[x ^ 2 + y ^ 2 + z ^ 2 == 1, {0, 0, 0}]}, Sphere[]}]See Also
GraphicsGroup Item Graphics Graphics3D Locator Text Rectangle Pane Panel PlotMarkers ImageSizeAction Scale Rotate Magnify AttachCell
Function Repository: TessellateGraphics
Tech Notes
Related Workflows
- Inset One Graphic into Another
History
Introduced in 2007 (6.0) | Updated in 2008 (7.0) ▪ 2014 (10.0)
Text
Wolfram Research (2007), Inset, Wolfram Language function, https://reference.wolfram.com/language/ref/Inset.html (updated 2014).
CMS
Wolfram Language. 2007. "Inset." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/Inset.html.
APA
Wolfram Language. (2007). Inset. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Inset.html
BibTeX
@misc{reference.wolfram_2026_inset, author="Wolfram Research", title="{Inset}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/Inset.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_inset, organization={Wolfram Research}, title={Inset}, year={2014}, url={https://reference.wolfram.com/language/ref/Inset.html}, note=[Accessed: 13-June-2026]}