WOLFRAM

ArrayPlot3D[array]

generates a plot in which the values in an array are shown in a discrete array of cubes.

Details and Options

Examples

open allclose all

Basic Examples  (4)Summary of the most common use cases

Plot an array of numbers:

Out[2]=2

Display the state of a 3D cellular automaton:

Out[1]=1

Specify overall color rules:

Out[1]=1

Use a standard blend as a color function:

Out[2]=2

Scope  (6)Survey of the scope of standard use cases

By default, 0 is not plotted and 1 is plotted in black:

Out[1]=1

With no opacity, 0 is plotted in white:

Out[1]=1

Plot data with units:

Out[1]=1

Plot a ragged array, padding on the right:

Out[1]=1

Cells with value None are rendered like the background:

Out[1]=1

Plot a sparse array:

Out[1]=1

Options  (32)Common values & functionality for each option

AspectRatio  (2)

Make all cells cubes:

Out[2]=2

Use a different aspect ratio:

Out[1]=1

By default, ArrayPlot3D does not show any axes:

Out[1]=1

AxesLabel  (3)

No axis labels are drawn by default:

Out[1]=1

Place a label on the axis:

Out[1]=1

Specify axes labels:

Out[1]=1

AxesStyle  (4)

Change the style for the axes:

Out[2]=2

Specify the style of each axis:

Out[1]=1

Use different styles for the ticks and the axes:

Out[1]=1

Use different styles for the labels and the axes:

Out[1]=1

ClippingStyle  (1)

The default is to not show values outside the plot range:

Out[2]=2

Show values outside the plot range in red:

Out[3]=3

Show low values in gray and high values in green:

Out[4]=4

ColorFunction  (2)

Map values from 0 to 1 onto colors according to Hue:

Out[2]=2

Use a pure function as the color function:

Out[3]=3

Use a named color gradient from ColorData:

Out[4]=4

Show elements with value 1 as black and all others as white:

Out[1]=1

ColorFunctionScaling  (1)

With ColorFunctionScaling->True, the values are first scaled to lie between 0 and 1:

Out[2]=2

ColorRules  (1)

Specify color rules for explicit values or patterns:

Out[2]=2

ColorFunction is used if no color rules apply:

Out[3]=3

Implement a "default color" by adding a rule for _:

Out[4]=4

Use any patterns in ColorRules:

Out[5]=5

Rules are used in the order given:

Out[6]=6

DataRange  (1)

By default, array values are assumed to have integer i, j and k values:

Out[2]=2

Specify the i, j, k coordinate range for tabular data:

Out[3]=3

DataReversed  (1)

Reverse the order of j and k values:

Out[2]=2

Reverse the order of i, j and k values:

Out[3]=3

Mesh  (1)

Insert mesh lines between all cells:

Out[2]=2

MeshStyle  (1)

Default mesh style:

Out[2]=2

Make the mesh pink:

Out[3]=3

OpacityFunction  (4)

OpacityFunction is Automatic by default:

Out[2]=2

Use None to make the whole array opaque:

Out[2]=2

Use a custom opacity function to specify the opacity for each value:

Out[2]=2

Use a constant opacity Opacity[0.5]:

Out[2]=2

OpacityFunctionScaling  (2)

By default, scaled values are used:

Out[2]=2

Use unscaled values by setting OpacityFunctionScaling to False:

Out[2]=2

PlotLegends  (2)

No legend is used by default:

Out[2]=2

Generate a legend automatically:

Out[3]=3

PlotLegends automatically picks up ColorFunction:

Out[1]=1

PlotRange  (2)

Plot all elements:

Out[2]=2

Plot only elements with values up to 3, leaving the rest empty:

Out[3]=3

The first three entries in PlotRange specify the range of i, j and k values to include:

Out[4]=4

Plot positive elements only:

Out[1]=1

PlotTheme  (1)

Use a theme with detailed ticks and a legend:

Out[2]=2

Ticks  (2)

Put ticks at round numbers:

Out[2]=2

Ticks at specific values:

Out[2]=2

Applications  (6)Sample problems that can be solved with this function

Cellular Automata  (2)

Plot the state of a 3D cellular automaton:

Out[1]=1

Plot the evolution of a 2D three-color cellular automaton:

Out[1]=1

Array Structures  (4)

Highlight a specific element in an array:

Out[3]=3

Highlight a column of values:

Out[3]=3

Highlight a slice of an array:

Out[3]=3

Highlight a sub-block of values:

Out[3]=3

Properties & Relations  (6)Properties of the function, and connections to other functions

Use ArrayPlot or MatrixPlot for 2D arrays:

Out[1]=1

ArrayPlot3D uses 3D arrays, even if one of the dimensions is 1:

Out[2]=2

Raster3D arranges elements in the opposite orders from ArrayPlot3D:

Out[1]=1

The DataReversed option allows ArrayPlot3D to use the same order as Raster3D:

Out[2]=2

Use ListDensityPlot3D for continuous densities, using varying opacity to see interior features:

Out[2]=2

Image3D uses interpolated volumetric rendering to display the data:

Out[2]=2

ReliefPlot creates artificial shadows for 2D data:

Out[1]=1

Use ComplexArrayPlot for 2D arrays of complex-valued data:

Out[1]=1

Neat Examples  (3)Surprising or curious use cases

Plot the Sin function at integer points:

Out[1]=1

Evolution of a totalistic 3D cellular automaton:

Out[1]=1

Interactively map GCD values onto colors using Hue:

Out[1]=1
Wolfram Research (2020), ArrayPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayPlot3D.html.
Wolfram Research (2020), ArrayPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayPlot3D.html.

Text

Wolfram Research (2020), ArrayPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayPlot3D.html.

Wolfram Research (2020), ArrayPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayPlot3D.html.

CMS

Wolfram Language. 2020. "ArrayPlot3D." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ArrayPlot3D.html.

Wolfram Language. 2020. "ArrayPlot3D." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ArrayPlot3D.html.

APA

Wolfram Language. (2020). ArrayPlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayPlot3D.html

Wolfram Language. (2020). ArrayPlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayPlot3D.html

BibTeX

@misc{reference.wolfram_2025_arrayplot3d, author="Wolfram Research", title="{ArrayPlot3D}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ArrayPlot3D.html}", note=[Accessed: 08-July-2025 ]}

@misc{reference.wolfram_2025_arrayplot3d, author="Wolfram Research", title="{ArrayPlot3D}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ArrayPlot3D.html}", note=[Accessed: 08-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_arrayplot3d, organization={Wolfram Research}, title={ArrayPlot3D}, year={2020}, url={https://reference.wolfram.com/language/ref/ArrayPlot3D.html}, note=[Accessed: 08-July-2025 ]}

@online{reference.wolfram_2025_arrayplot3d, organization={Wolfram Research}, title={ArrayPlot3D}, year={2020}, url={https://reference.wolfram.com/language/ref/ArrayPlot3D.html}, note=[Accessed: 08-July-2025 ]}