|
SOLUTIONS
|
Search for all pages containing ArrayPlot
BUILT-IN MATHEMATICA SYMBOL
ArrayPlot[array]
generates a plot in which the values in an array are shown in a discrete array of squares.
Details and OptionsDetails and Options
- ArrayPlot[array] by default arranges successive rows of array down the page and successive columns across, just as a table or grid would normally be formatted. »
- If array contains 0s and 1s, the 1s will appear as black squares and the 0s as white squares.
- ArrayPlot by default generates grayscale output, in which zero values are shown white, and the maximum positive or negative value is shown black. »
- With an explicit setting for PlotRange, ArrayPlot by default makes the minimum value white and the maximum black.
- The following special entries can be used: »
-
None background color color directive specified color - If array is ragged, shorter rows are treated as padded on the right with background. »
- ArrayPlot has the same options as Graphics, with the following additions and changes:
-
AspectRatio Automatic ratio of height to width ClippingStyle None how to show cells whose values are clipped ColorFunction Automatic how each cell should be colored ColorFunctionScaling True whether to scale the argument to ColorFunction ColorRules Automatic rules for determining colors from values DataRange All the range of
and
values to assume DataReversed False whether to reverse the order of rows Frame Automatic whether to draw a frame around the plot FrameLabel None labels for rows and columns FrameTicks None what ticks to include on the frame MaxPlotPoints Infinity the maximum number of points to include Mesh False whether to draw a mesh MeshStyle GrayLevel[GoldenRatio-1] the style to use for a mesh PixelConstrained False how to constrain cells to align with pixels PlotLegends None legends for datasets PlotRange All the range of values to plot - The rules given by ColorRules are applied to the value
of each cell. The rules can involve patterns. » - If none of the rules in ColorRules apply, then ColorFunction is used to determine the color.
- With the default setting ColorRules->Automatic, an explicit setting ColorFunction->f is used instead of ColorRules.
- With the default setting ColorFunctionScaling->False, each value
is supplied as the argument to any function given for ColorFunction. » - With ColorFunctionScaling->True, the values are scaled to lie between 0 and 1. »
- If the color determined for a particular cell is None, the cell is rendered in the background color.
- If no color is determined for a particular cell, the cell is rendered in a default dark red color.
- With DataReversed->True, the order of rows is reversed, so that rows run from bottom to top, with the last row at the top.
- With the setting FrameTicks->Automatic, ticks are placed at round integers, typically multiples of 5 or 10. »
- With the setting FrameTicks->All, ticks are also placed at the minimum and maximum
and
. » - In explicit FrameTicks specifications, the tick coordinates are taken to refer to
and
. - With DataReversed->True, tick values decrease from top to bottom.
- PlotRange->amax specifies that only those
between 0 and
should be shown. » - PlotRange->{amin, amax} specifies that
between
and
should be shown. - PlotRange->{{imin, imax}, {jmin, jmax}} shows only elements with
and
in the specified ranges. The top-left element has
,
. With the default setting DataReversed->False,
increases down the page;
increases to the right. - PlotRange->{ispec, jspec, aspec} shows only elements in the specified ranges of
,
, and value. » - With the default setting for ColorFunction, PlotRange->{amin, amax} specifies that values from
to
should be shown with gray scales varying from white to black. - Mesh->True draws mesh lines between each cell in the array.
- Mesh->{mi, mj} gives mesh specifications for the
and
directions, respectively. - With the default setting Frame->Automatic, a frame is drawn only when Mesh->False.
- For purposes of combining with other graphics, the array element
is taken to cover a unit square centered at coordinate position
,
. - A setting DataRange->{{xmin, xmax}, {ymin, ymax}} specifies that the centers of successive cells should be at equally spaced positions between
and
in the horizontal direction, and
and
in the vertical direction. With the default setting DataReversed->False,
is centered at
. - With the default setting DataRange->All and DataReversed->False, the array element
will be taken to cover a unit square centered at coordinate position
,
. - ArrayPlot returns Graphics[Raster[data], opts].
- With PixelConstrained->True, ArrayPlot generates a Raster with an absolute size that aligns cells with pixels, so that each cell is an integer number of pixels across or each pixel is an integer number of cells across. The cells are each taken to be as large as possible, given the ImageSize setting specified. »
- ArrayPlot works with SparseArray objects. »
New in 5.1 | Last modified in 9
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »


