GraphicsGrid
✖
GraphicsGrid
generates a graphic in which the gij are laid out in a two-dimensional grid.
Details and Options




- If the gij are graphics with ImageSize->Automatic, GraphicsGrid will if possible resize them to make them fit into the grid as well as possible, while preserving their individual aspect ratios.
- The output from GraphicsGrid can interactively be resized, or edited as a graphic.
- The listi in GraphicsGrid[{list1,list2,…}] do not all need to be the same length; there will be empty space in the grid at the ends of shorter rows.
- You can specify that an element e should span multiple positions in a grid using, for example, GraphicsGrid[{{e,SpanFromLeft,SpanFromLeft},…}].
- The following specify that a particular position should be spanned:
-
SpanFromLeft span from left SpanFromAbove span from above SpanFromBoth span from both left and above - A particular element can span both multiple rows and multiple columns by having a rectangular section of the array with the form {{e,SpanFromLeft,SpanFromLeft,…}, {SpanFromAbove,SpanFromBoth,SpanFromBoth,…},…}.
- The following options can be given:
-
Alignment {Center,Center} horizontal and vertical alignment of elements AspectRatio Automatic ratio of height to width for the whole grid Background None what background colors to use BaselinePosition Automatic what to align with the surrounding text baseline BaseStyle {} base style specifications for the grid Dividers None where to draw divider lines in the grid Frame None where to draw frames in the grid FrameStyle Automatic styles to use for frames ImageSize Automatic overall size of the whole graphics grid ItemAspectRatio Automatic ratio of height to width for each item Spacings Scaled[0.1] horizontal and vertical spacings - With AspectRatio->Automatic, the aspect ratio of the whole graphics grid will be chosen so as to best fit the individual objects in the grid.
- Settings for the options Alignment, Background, and Frame can be given as follows to apply separately to different items:
-
spec apply spec to all items {specx} apply specx at successive horizontal positions {specx,specy} apply speck at successive horizontal and vertical positions also allow explicit rules for individual elements
- The speck can have the following forms:
-
{s1,s2,…,sn} use through
, then use defaults
{{c}} use in all cases
{{c1,c2}} alternate between and
{{c1,c2,…}} cycle through all ci {s,{c}} use , then repeatedly use
{s1,{c},sn} use , then repeatedly use
, but use
at the end
{s1,s2,…,{c1,c2,…},sm,…,sn} use the first sequence of at the beginning, then cyclically use the ci, then use the last sequence of
at the end
{s1,s2,…,{},sm,…,sn} use the first sequence of 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
, if there are more
specified than items across the grid,
from the beginning are used for the first items, and ones from the end are used for the last items.
- Settings such as Alignment, Background, and Frame can effectively be specified for individual items in the grid using Item.
- GraphicsGrid will not change the size of graphics or other objects that have explicit ImageSize settings, unless the GraphicsGrid itself is resized or given an overall ImageSize setting.
- Common settings for Frame include:
-
None no frame True frame around the whole grid All frame around every item in the grid {All,False} put a frame at every horizontal position (column lines) {False,All} put a frame at every vertical position (row lines) - Settings for Dividers and Spacings can have the following forms:
-
spec apply spec to all gaps between items {specx,specy} apply speci to successive horizontal and vertical gaps - The speci can have the same forms as for Alignment, Background, and other item-oriented options.
- For a grid with
items in a particular direction, Dividers and Spacings can specify settings for the
gaps between elements, starting before the first element and ending after the last element.
- The following settings can be used for BaselinePosition:
-
Axis axis of the middle row in the grid (default) Baseline baseline of the middle row in the grid Bottom bottom of the whole grid Center halfway from top to bottom Top top of the whole grid {{i,j},pos} position pos in element - The settings for BaseStyle are appended to the default style typically given by the "GraphicsGrid" style in the current stylesheet.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (17)Survey of the scope of standard use cases
Frames and Grid Lines (5)
Put a frame around the whole grid:

https://wolfram.com/xid/0tz1qxfu-bbpa2o

Put a frame around every element:

https://wolfram.com/xid/0tz1qxfu-gsc84x


https://wolfram.com/xid/0tz1qxfu-2mnjal

Put a frame around the first row and column:

https://wolfram.com/xid/0tz1qxfu-cbpht5

Draw different frames with different styles:

https://wolfram.com/xid/0tz1qxfu-ud2x0h

Put dividers at all horizontal positions:

https://wolfram.com/xid/0tz1qxfu-mo15iw

Put dividers at all vertical positions:

https://wolfram.com/xid/0tz1qxfu-e7ls8

Put dividers at the third horizontal and second vertical positions:

https://wolfram.com/xid/0tz1qxfu-k67otn

Spanning Elements (3)
Make element 4 span the column to its right:

https://wolfram.com/xid/0tz1qxfu-4x9p6q

https://wolfram.com/xid/0tz1qxfu-f1j5kh


https://wolfram.com/xid/0tz1qxfu-bigdgf

Make element 2 span the row below it:

https://wolfram.com/xid/0tz1qxfu-qmjl6t

https://wolfram.com/xid/0tz1qxfu-bjilaz


https://wolfram.com/xid/0tz1qxfu-j9ntkl


https://wolfram.com/xid/0tz1qxfu-wpb53j

https://wolfram.com/xid/0tz1qxfu-n5900p

Alignment (1)
Styling (5)
Draw the grid with a pink background:

https://wolfram.com/xid/0tz1qxfu-lqbfpn

A pink background for the column at the first horizontal position:

https://wolfram.com/xid/0tz1qxfu-bnroag

Alternating pink and yellow at successive vertical positions:

https://wolfram.com/xid/0tz1qxfu-dpn9cb

Alternating pink and yellow at successive horizontal positions:

https://wolfram.com/xid/0tz1qxfu-uzsaa

Embed styling options with a particular grid item:

https://wolfram.com/xid/0tz1qxfu-g0cn6a

https://wolfram.com/xid/0tz1qxfu-ku8z1q

Spacing (1)
Irregular Shapes (1)
Options (17)Common values & functionality for each option
AspectRatio (2)
If possible GraphicsGrid will choose an aspect ratio suitable to its elements:

https://wolfram.com/xid/0tz1qxfu-1vxnay

When no reasonable choice can be made, a default aspect ratio of 1 is used:

https://wolfram.com/xid/0tz1qxfu-wjqqwq

Setting the aspect ratio of each item explicitly:

https://wolfram.com/xid/0tz1qxfu-yit0a3

Background (7)
Draw the grid with a pink background:

https://wolfram.com/xid/0tz1qxfu-l5rbwg

Pink and red backgrounds for the first and second horizontal positions:

https://wolfram.com/xid/0tz1qxfu-4y5go5


https://wolfram.com/xid/0tz1qxfu-zqd9oa

Pink and red backgrounds for the first and second vertical positions:

https://wolfram.com/xid/0tz1qxfu-jgne6m

Alternating pink and red backgrounds:

https://wolfram.com/xid/0tz1qxfu-57g14a

Alternating backgrounds with yellow superimposed in the first and last positions:

https://wolfram.com/xid/0tz1qxfu-hpart3


https://wolfram.com/xid/0tz1qxfu-iz40di

Set the background for specific items:

https://wolfram.com/xid/0tz1qxfu-xouktx

Set the background for a subregion of the grid:

https://wolfram.com/xid/0tz1qxfu-hrrawi

BaselinePosition (1)
Frame (3)
FrameStyle (3)
FrameStyle supports a variety of graphics directives:

https://wolfram.com/xid/0tz1qxfu-7jhzp1

FrameStyle is applied to all sources of grid lines, including Dividers and Item:

https://wolfram.com/xid/0tz1qxfu-xqqb6j

https://wolfram.com/xid/0tz1qxfu-fcx7w4

Directives given with FrameStyle are combined with those specified elsewhere:

https://wolfram.com/xid/0tz1qxfu-ynfrbu

https://wolfram.com/xid/0tz1qxfu-679ofv

ImageSize (1)
By default, GraphicsGrid will display graphics at their specified sizes:

https://wolfram.com/xid/0tz1qxfu-54o599

Giving an ImageSize setting to the GraphicsGrid will scale the graphics appropriately:

https://wolfram.com/xid/0tz1qxfu-do170k

Applications (2)Sample problems that can be solved with this function
Possible Issues (1)Common pitfalls and unexpected behavior
To span across both rows and columns requires appropriate use of SpanFromBoth:

https://wolfram.com/xid/0tz1qxfu-ffm7z7

https://wolfram.com/xid/0tz1qxfu-7kfcna


https://wolfram.com/xid/0tz1qxfu-8z5anv

Wolfram Research (2007), GraphicsGrid, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphicsGrid.html.
Text
Wolfram Research (2007), GraphicsGrid, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphicsGrid.html.
Wolfram Research (2007), GraphicsGrid, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphicsGrid.html.
CMS
Wolfram Language. 2007. "GraphicsGrid." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GraphicsGrid.html.
Wolfram Language. 2007. "GraphicsGrid." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GraphicsGrid.html.
APA
Wolfram Language. (2007). GraphicsGrid. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphicsGrid.html
Wolfram Language. (2007). GraphicsGrid. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphicsGrid.html
BibTeX
@misc{reference.wolfram_2025_graphicsgrid, author="Wolfram Research", title="{GraphicsGrid}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/GraphicsGrid.html}", note=[Accessed: 25-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_graphicsgrid, organization={Wolfram Research}, title={GraphicsGrid}, year={2007}, url={https://reference.wolfram.com/language/ref/GraphicsGrid.html}, note=[Accessed: 25-March-2025
]}