Frame
Details
- The following basic settings can be given:
-
True draw a frame around the whole object False or None draw no frame All draw frames around each entry in Grid, etc. - For Graphics, Plot, and related functions, Frame->{{left,right},{bottom,top}} specifies whether to draw a frame on each edge. With the default setting FrameTicks->Automatic, ticks are included whenever a frame is drawn.
- For Grid and related constructs, lists of settings can be given. Common cases include:
-
{All,False} put frames at all horizontal positions (column lines) {False,All} put frames at all vertical positions (row lines) {-1->True} a frame around the last column {False,-1->True} a frame around the last row - General settings for Frame in Grid and related constructs can be given as:
-
spec apply spec to all items {specx} apply specx at successive horizontal positions {specx,specy} apply speck at successive horizontal and vertical positions {specx,specy,rules} also allow explicit rules for individual i,j elements - The speck can have the following forms:
-
{s1,s2,…,sn} use s1 through sn; then use defaults {{c}} use c in all cases {{c1,c2}} alternate between c1 and c2 {{c1,c2,…}} cycle through all ci {s,{c}} use s, then repeatedly use c {s1,{c},sn} use s1, then repeatedly use c, but use sn at the end {s1,s2,…,{c1,c2,…},sm,…,sn} use the first sequence of si at the beginning, then cyclically use the ci, then use the last sequence of si at the end {s1,s2,…,{},sm,…,sn} use the first sequence of si at the beginning and the last sequence at the end {i1->v1,i2->v2,…} specify what to use at positions ik {spec,rules} use rules to override specifications in spec - With settings of the form {s1,s2,…,{…},sm,…,sn}, if there are more si specified than items across the grid, si from the beginning are used for the first items, and ones from the end are used for the last items.
- Rules of the form {{imin,imax},{jmin,jmax}}->v can be used to specify frames for regions of a grid.
Examples
open all close allBasic Examples (4)
Plot[Sin[x], {x, 0, 10}, Frame -> True]Put a frame on the left and right edges:
Plot[Sin[x], {x, 0, 10}, Frame -> {{True, True}, {False, False}}]Grid[Table[x, {4}, {7}], Frame -> True]Frame all elements in the grid:
Grid[Table[x, {4}, {7}], Frame -> All]Specify overall frame style, including frame ticks and frame tick labels, using FrameStyle:
Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameStyle -> Directive[Orange, 12]]Scope (9)
Frame Positions (2)
Put a frame on the top and the bottom edges:
Plot[Sin[x], {x, 0, 10}, Frame -> {{False, False}, {True, True}}]Put a frame on all the columns:
Grid[Table[x, {4}, {7}], Frame -> {All, False}]Grid[Table[x, {4}, {7}], Frame -> {False, All}]Frame Styling (2)
Frame Labels and Ticks (5)
Place labels on the bottom and left frame edges:
Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {{y, Sin[x]}, {x, "plot"}}]Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None]Place frame tick marks and labels automatically:
Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> Automatic]Place frame tick marks at the specified positions:
Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> {{{-1, 0, 1}, None}, {{0, Pi, 2Pi, 3Pi}, None}}]Generalizations & Extensions (10)
Grid Frame Positions (6)
Put no frame on the first column, a frame on the second, then repeat the default (which is no frame):
Grid[Table[x, {4}, {7}], Frame -> {{None, True}, None}]Put no frame on the first column, then put a frame on the second and all subsequent columns:
Grid[Table[x, {4}, {7}], Frame -> {{None, {True}}, None}]Put no frame on the first row, a frame on the second, then repeat the default (which is no frame):
Grid[Table[x, {4}, {7}], Frame -> {None, {None, True}}]Frame a specific row and column:
Grid[Table[x, {4}, {7}], Frame -> {3 -> True, 2 -> True}]Frame the last column and the last row:
Grid[Table[x, {4}, {7}], Frame -> {-1 -> True, -1 -> True}]Grid[Table[x, {4}, {7}], Frame -> {None, None, {{1, 1} -> True, {3, 3} -> True}}]Grid[Table[x, {4}, {7}], Frame -> {None, None, {{{1, 3}, {2, 4}} -> True}}]Put a frame around an individual element in the grid:
Grid[{{Item[a, Frame -> True], b}, {c, d}}]Grid Frame Styling (4)
Frame rows and columns with specific styles:
Grid[Table[x, {4}, {7}], Frame -> {3 -> Red, 2 -> Directive[Blue, Thick]}]Frame a region of the grid with specific styles:
Grid[Table[x, {4}, {7}], Frame -> {None, None, {{{1, 3}, {2, 4}} -> Thick, {{3, 4}, {1, 6}} -> Red}}]Put a styled frame around an individual element:
Grid[{{Item[a, Frame -> True, FrameStyle -> Directive[Red, Thick]], b}, {c, d}}]Individually styled frames can be used with FrameStyle, and have higher priority:
Grid[Table[x, {4}, {7}], Frame -> {{1 -> Red, 3 -> Dashed}, 2 -> Directive[Green, Thin]}, FrameStyle -> Directive[StandardGray, Thick]]Applications (1)
Properties & Relations (3)
Dividers can be used to individually specify the dividers between rows and columns:
Grid[Table[x, {4}, {7}], Dividers -> {{True}, {True}}]Grid[Table[x, {4}, {7}], Frame -> {{True}, {True}}]In 2D, frames are drawn above the graphics:
Graphics[{Pink, Disk[]}, Frame -> True, PlotRange -> {{0, 1}, {0, 1}}]Objects in Epilog are drawn on top of any graphics, including frames:
Graphics[{Pink, Disk[]}, Frame -> True, Epilog -> {Blue, Disk[{0, 0}, .5]}, PlotRange -> {{0, 1}, {0, 1}}]GridLines puts grids across the image:
Graphics[Circle[], GridLines -> Automatic, Frame -> True]Related Workflows
- Put a Frame around a Cell
Related Links
History
Introduced in 1991 (2.0) | Updated in 2007 (6.0)
Text
Wolfram Research (1991), Frame, Wolfram Language function, https://reference.wolfram.com/language/ref/Frame.html (updated 2007).
CMS
Wolfram Language. 1991. "Frame." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/Frame.html.
APA
Wolfram Language. (1991). Frame. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Frame.html
BibTeX
@misc{reference.wolfram_2026_frame, author="Wolfram Research", title="{Frame}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Frame.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_frame, organization={Wolfram Research}, title={Frame}, year={2007}, url={https://reference.wolfram.com/language/ref/Frame.html}, note=[Accessed: 13-June-2026]}