---
title: "LabeledGraphicsBox"
language: "en"
type: "Symbol"
summary: "LabeledGraphicsBox[box, lbl] is a low-level construct that represents a graphics box with a label attached to it. LabeledGraphicsBox[box, lbl, pos] places lbl at a position specified by pos. LabeledGraphicsBox[box, {lbl1, lbl2, ...}, {pos1, pos2, ...}] places the lbli at positions posi."
keywords: 
- graphics label
- plot label
- labeled graphic
- graphic caption
- captioned graphic
canonical_url: "https://reference.wolfram.com/language/ref/LabeledGraphicsBox.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Low-Level Notebook Structure"
    link: "https://reference.wolfram.com/language/guide/LowLevelNotebookStructure.en.md"
related_functions: 
  - 
    title: "Labeled"
    link: "https://reference.wolfram.com/language/ref/Labeled.en.md"
  - 
    title: "PlotLabel"
    link: "https://reference.wolfram.com/language/ref/PlotLabel.en.md"
  - 
    title: "FrameLabel"
    link: "https://reference.wolfram.com/language/ref/FrameLabel.en.md"
  - 
    title: "Callout"
    link: "https://reference.wolfram.com/language/ref/Callout.en.md"
  - 
    title: "Legended"
    link: "https://reference.wolfram.com/language/ref/Legended.en.md"
  - 
    title: "GridBox"
    link: "https://reference.wolfram.com/language/ref/GridBox.en.md"
  - 
    title: "AdjustmentBox"
    link: "https://reference.wolfram.com/language/ref/AdjustmentBox.en.md"
---
# LabeledGraphicsBox
⚠ *Unsupported in Cloud*
*New in 14*

LabeledGraphicsBox[box, lbl] is a low-level construct that represents a graphics box with a label attached to it.

LabeledGraphicsBox[box, lbl, pos] places lbl at a position specified by pos.

LabeledGraphicsBox[box, {lbl1, lbl2, …}, {pos1, pos2, …}] places the lbli at positions posi.

## Details and Options

* ``LabeledGraphicsBox`` is one possible low-level representation of ``Labeled``. Except for low-level notebook expression manipulation, ``LabeledGraphicsBox`` should not need to be used directly.

* ``box`` must be a GraphicsBox, Graphics3DBox or a ``LabeledGraphicsBox``.

* Selecting a ``LabeledGraphicsBox`` will result in a graphics-style selection with resize handles that can be used to resize the whole construct.

* Resizing a ``LabeledGraphicsBox`` will automatically resize ``box`` to use the full available space, minus the space required to draw labels.

* Possible forms for the ``posi`` are:

|               |                                                     |
| :------------ | :-------------------------------------------------- |
| side          | centered on the specified side                      |
| {side, align} | on the specified side with the specified alignment  |

* Possible forms for ``side`` include ``Bottom``, ``Left``, ``Top``, ``Right``.

* Possible forms for ``align`` include ``Center``, ``Left``, ``Right``, ``Bottom``, ``Top``.

* The effective default for ``pos`` is normally ``Bottom``.

* The following options can be given:

|                   |                        |                                             |
| ----------------- | ---------------------- | ------------------------------------------- |
| BaselinePosition  | Automatic              | the position of the base line for the box   |
| BaseStyle         | "LabeledGraphics"      | base style specifications for the whole box |
| DefaultLabelStyle | "LabeledGraphicsLabel" | base style specifications for the whole box |
| ImageMargins      | 0                      | margins to add outside the display area     |
| ImageSize         | Automatic              | the overall image size of the box           |
| LabelStyle        | Automatic              | style specification for the lbli            |
| Spacings          | Automatic              | horizontal and vertical label spacings      |

* ``ImageSize -> Automatic`` will cause ``LabeledGraphicsBox`` to display ``box`` at its specified size and add additional space as needed to fit the ``lbli``. Other values will set the absolute size of the entire construct and resize ``box`` automatically to fit in the available space.

* ``LabeledGraphicsBox`` is used in the typesetting of some ``Labeled`` constructs.

## Examples (36)

### Basic Examples (4)

A 2D labeled graphic:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{DiskBox[]}], "a disk"]]

Out[1]= Labeled[[image], a disk]
```

---

A 3D labeled graphic:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[Graphics3DBox[{SphereBox[{0, 0, 0}]}], "a sphere"]]

Out[1]= Labeled[[image], a sphere]
```

---

Label positioned at the left of a graphic:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{DiskBox[]}], "a disk", Left]]

Out[1]= Labeled[[image], a disk]
```

---

A label on the left and a label at the top:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{DiskBox[]}], {"xxx", "yyy"}, {Left, Top}]]

Out[1]= Labeled[[image], xxxyyy]
```

### Scope (15)

#### Label Content (6)

Label a graphic:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[]], RowBox[{"a", " ", "circle"}]]]

Out[1]= Labeled[[image], a circle]
```

---

Label a 3D graphic:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[Graphics3DBox[CuboidBox[{0, 0, 0}]], RowBox[{"a", " ", "cube"}]]]

Out[1]= Labeled[[image], a cube]
```

---

Use a checkbox as a label:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[]], CheckboxBox[True]]]

Out[1]= Labeled[[image], [✓]]
```

---

Use a checkbox as a label for a 3D graphic:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[Graphics3DBox[SphereBox[{0, 0, 0}]], CheckboxBox[True]]]

Out[1]= Labeled[[image], [✓]]
```

---

Use graphics as labels:

```wl
In[1]:= d = GraphicsBox[CircleBox[], ImageSize -> 20];

In[2]:= RawBoxes[LabeledGraphicsBox[Graphics3DBox[SphereBox[{0, 0, 0}]], {d, d, d}, {Top, Bottom, Left}]]

Out[2]= Labeled[[image], [image][image][image]]
```

---

Use 3D graphics as labels:

```wl
In[1]:= lbl3D = Graphics3DBox[SphereBox[{0, 0, 0}], ImageSize -> 20];

In[2]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], {lbl3D, lbl3D, lbl3D}, {Top, Bottom, Left}]]

Out[2]= Labeled[[image], [image][image][image]]
```

#### Label Placement (4)

Control the placement of labels:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[]], {"Left", "Right", "Top", "Bottom"}, {Left, Right, Top, Bottom}]]

Out[1]= Labeled[[image], LeftRightTopBottom]
```

---

Place the label at the bottom, aligned to the left:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[]], "Bottom, Left", {Bottom, Left}]]

Out[1]= Labeled[[image], Bottom, Left]
```

---

Put the label on the right, aligned to the top:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[]], "Right, Top", {Right, Top}]]

Out[1]= Labeled[[image], Right, Top]
```

---

A label on the right aligned to the top compared to a label at the top aligned to the right:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[], Background -> RGBColor[1, 1, 0.85]], {"Right Top", "Top Right"}, {{Right, Top}, {Top, Right}}]]

Out[1]= Labeled[[image], Right TopTop Right]
```

#### Box Usage (5)

Create a nested ``LabeledGraphicsBox`` :

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[LabeledGraphicsBox[Graphics3DBox[CuboidBox[{0, 0, 0}]], {"Nested Left", "Nested Top", "Nested Right", "Nested Bottom"}, {Left, Top, Right, Bottom}], {GraphicsBox[DiskBox[{0, 0}], ImageSize -> Tiny], GraphicsBox[{RGBColor[1, 0, 0], CircleBox[{0, 0}]}, ImageSize -> Tiny]}, {Top, Left}]]

Out[1]= Labeled[Labeled[[image], Nested LeftNested TopNested RightNested Bottom], [image][image]]
```

---

Use a ``LabeledGraphicsBox`` as a label:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[LabeledGraphicsBox[Graphics3DBox[CuboidBox[{0, 0, 0}]], {Left, Top, Right, Bottom}, {Left, Top, Right, Bottom}], {LabeledGraphicsBox[GraphicsBox[DiskBox[{0, 0}], ImageSize -> Tiny], {Left, Right, Top, Bottom}, {Left, Right, Top, Bottom}], GraphicsBox[{RGBColor[1, 0, 0], CircleBox[{0, 0}]}, ImageSize -> Tiny]}, {Top, Left}]]

Out[1]= Labeled[Labeled[[image], LeftTopRightBottom], Labeled[[image], LeftRightTopBottom][image]]
```

---

Use multiple levels of nested ``LabeledGraphicsBox`` instances using nested ``LabeledGraphicsBox`` instances as labels:

```wl
In[1]:= RawBoxes[NestList[LabeledGraphicsBox[#, {#, #}, {Top, Left}]&, GraphicsBox[DiskBox[{0, 0}], ImageSize -> 30], 2]]

Out[1]=
[image]
Labeled[[image], [image][image]]
Labeled[Labeled[[image], [image][image]], Labeled[[image], [image][image]]Labeled[[image], [image][image]]]
```

---

Use ``LabeledGraphicsBox`` as an ``Inset`` :

```wl
In[1]:=
RawBoxes[GraphicsBox[{InsetBox[
	LabeledGraphicsBox[Graphics3DBox[SphereBox[{0, 0, 0}]], "Top", Top]
	]}]]

Out[1]= [image]
```

---

Use ``LabeledGraphicsBox`` as an ``Inset`` in a 3D graphic:

```wl
In[1]:=
RawBoxes[Graphics3DBox[{Inset3DBox[{
	LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], "Top", Top]
	}, {0, 0, 0}]}]]

Out[1]= [image]
```

### Options (15)

#### Background (1)

Change the overall background color:

```wl
In[1]:=
RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}]}], 
	"Label", Background -> LightYellow]]

Out[1]= Labeled[[image], Label]
```

#### BaselinePosition (1)

Align with surrounding text:

```wl
In[1]:=
Row[Table[RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}]}], 
	"Label", Background -> LightYellow, BaselinePosition -> p]], {p, {Top, Center, Bottom}}], " xxx "]

Out[1]= Row[{Labeled[[image], Label], Labeled[[image], Label], Labeled[[image], Label]}, " xxx "]
```

#### BaseStyle (1)

Set the starting style:

```wl
In[1]:=
RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}]}], 
	"Label", Background -> LightYellow, BaseStyle -> Blue]]

Out[1]= Labeled[[image], Label]
```

#### ContentSelectable (1)

By default, editing of labels and expressions is allowed:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], 123456]]

Out[1]= Labeled[[image], 123456]
```

Disallow editing:

```wl
In[2]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], 123456, ContentSelectable -> False]]

Out[2]= Labeled[[image], 123456]
```

#### ImageMargins (1)

Add margins around the labeled expression:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}, 1]}, Background -> RGBColor[1, 1, 0.85]], "abcdef", Background -> RGBColor[0.87, 0.94, 1], ImageMargins -> 30]]

Out[1]= Labeled[[image], abcdef]
```

Specify different margins for each side:

```wl
In[2]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}, 1]}, Background -> RGBColor[1, 1, 0.85]], "abcdef", Background -> RGBColor[0.87, 0.94, 1], ImageMargins -> {{5, 10}, {20, 30}}]]

Out[2]= Labeled[[image], abcdef]
```

#### ImageSize (1)

The image size by default is the size of the inner graphic plus the space for the labels:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], 123456]]

Out[1]= Labeled[[image], 123456]
```

Giving explicit values to ``ImageSize`` resizes the inner graphic to fill the available space:

```wl
In[2]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], 123456, ImageSize -> {100, 200}]]

Out[2]= Labeled[[image], 123456]
```

``ImageSize`` resizes the inner graphic even if it has an explicitly larger size:

```wl
In[3]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}], ImageSize -> {1000, 1000}], 123456, ImageSize -> {100, 200}]]

Out[3]= Labeled[[image], 123456]
```

#### LabelStyle (1)

Style the labels:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}, 1], InsetBox["abc", {0, 0}]}, Background -> RGBColor[1, 1, 0.85]], "Label", LabelStyle -> Red]]

Out[1]= Labeled[[image], Label]
```

#### RotateLabel (4)

Specify that the label should be rotated:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], "Rotated Label", Left, RotateLabel -> True]]

Out[1]= Labeled[[image], Rotated Label]
```

---

Rotate the label to a particular angle in degrees:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], "Rotated Label", Left, RotateLabel -> 60 Degree]]

Out[1]= Labeled[[image], Rotated Label]
```

Rotate the label to a particular angle using radians:

```wl
In[2]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], "Rotated Label", Left, RotateLabel -> N[Pi / 4]]]

Out[2]= Labeled[[image], Rotated Label]
```

---

Specify custom rotations for the different labels:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], {"Left", "Right", "Top", "Bottom"}, {Left, Right, Top, Bottom}, RotateLabel -> {True, N[-Pi / 2], 30Degree, None}]]

Out[1]= Labeled[[image], LeftRightTopBottom]
```

---

Rotate nested labels:

```wl
In[1]:=
RawBoxes[
	LabeledGraphicsBox[
	LabeledGraphicsBox[
	ToBoxes[Graphics3D[Cuboid[], Background -> LightYellow]], {Left, Top, Right, Bottom}, {Left, Top, Right, Bottom}, RotateLabel -> 15Degree], 
	{LabeledGraphicsBox[
	ToBoxes[Graphics[Rectangle[], ImageSize -> Tiny]], {Left, Right, Top, Bottom}, {Left, Right, Top, Bottom}, RotateLabel -> {Automatic, 45 Degree, 90 Degree}, 
	Background -> LightGreen], ToBoxes[Graphics[{Red, Circle[]}, ImageSize -> Tiny, Background -> LightOrange]]}, {Top, Left}, RotateLabel -> {-45Degree, Automatic}]]

Out[1]= Labeled[Labeled[[image], LeftTopRightBottom], Labeled[[image], LeftRightTopBottom][image]]
```

#### Spacings (4)

Add horizontal spacing between the expression and the label:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}, 1]}, Background -> RGBColor[1, 1, 0.85]], {"Bottom", "Top", "Left", "RightTop"}, {Bottom, Top, Left, {Right, Top}}, Background -> LightBlue, Spacings -> {30, Automatic}]]

Out[1]= Labeled[[image], BottomTopLeftRightTop]
```

---

Specify vertical spacing:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}, 1]}, Background -> RGBColor[1, 1, 0.85]], {"Bottom", "Top", "Left", "RightTop"}, {Bottom, Top, Left, {Right, Top}}, Background -> LightBlue, Spacings -> {Automatic, 30}]]

Out[1]= Labeled[[image], BottomTopLeftRightTop]
```

---

Use both vertical and horizontal spacing:

```wl
In[1]:= RawBoxes[LabeledGraphicsBox[GraphicsBox[{CircleBox[{0, 0}, 1]}, Background -> RGBColor[1, 1, 0.85]], {"Bottom", "Top", "Left", "RightTop"}, {Bottom, Top, Left, {Right, Top}}, Background -> LightBlue, Spacings -> {60, 30}]]

Out[1]= Labeled[[image], BottomTopLeftRightTop]
```

---

Dynamically update the rotation of the labels:

```wl
In[1]:=
angle = 0;
{Slider[Dynamic[angle], {0, 2Pi}], Dynamic[angle]}
RawBoxes[LabeledGraphicsBox[GraphicsBox[CircleBox[{0, 0}]], {"Left", "Right", "Top", "Bottom"}, {Left, Right, Top, Bottom}, RotateLabel -> Dynamic[angle]]]

Out[1]=
{Slider[Dynamic[BoxForm`RemapVariable[angle, {0, 2*Pi}], 
  BoxForm`RemapValue[#1, angle, {0, 2*Pi}] & ], {0, 1}], Dynamic[angle]}

Out[1]= Labeled[[image], LeftRightTopBottom]
```

### Applications (2)

Label images with checkboxes, potentially for later processing:

```wl
In[1]:= Table[RawBoxes[LabeledGraphicsBox[ToBoxes[ArrayPlot[CellularAutomaton[i, {{1}, 0}, {30, All}], ImageSize -> Small]], ToBoxes[Checkbox[]]]], {i, 20, 23}]

Out[1]= {Labeled[[image], [ ]], Labeled[[image], [ ]], Labeled[[image], [ ]], Labeled[[image], [ ]]}
```

---

Create an active label:

```wl
In[1]:= DynamicModule[{c}, RawBoxes[LabeledGraphicsBox[ToBoxes[Graphics[{Dynamic[c], Disk[]}, ImageSize -> Tiny]], ToBoxes[Toggler[Dynamic[c], Reverse /@ ColorData["HTML", "ColorRules"], ImageSize -> Automatic]]]]]

Out[1]= DynamicModule[«3»]
```

## See Also

* [`Labeled`](https://reference.wolfram.com/language/ref/Labeled.en.md)
* [`PlotLabel`](https://reference.wolfram.com/language/ref/PlotLabel.en.md)
* [`FrameLabel`](https://reference.wolfram.com/language/ref/FrameLabel.en.md)
* [`Callout`](https://reference.wolfram.com/language/ref/Callout.en.md)
* [`Legended`](https://reference.wolfram.com/language/ref/Legended.en.md)
* [`GridBox`](https://reference.wolfram.com/language/ref/GridBox.en.md)
* [`AdjustmentBox`](https://reference.wolfram.com/language/ref/AdjustmentBox.en.md)

## Related Guides

* [Low-Level Notebook Structure](https://reference.wolfram.com/language/guide/LowLevelNotebookStructure.en.md)

## History

* [Introduced in 2025 (14.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn142.en.md)