ComplexArrayPlot

ComplexArrayPlot[array]

generates a plot in which complex values zij in an array array are shown in a discrete array of squares with Arg[zij] indicated by color and Abs[zij] by shading.

Details and Options

Examples

open allclose all

Basic Examples  (6)

Plot an array of numbers:

Give explicit color directives to specify colors for individual cells:

Specify overall color rules:

Include a mesh:

Plot a table of data:

Use a standard blend as a color function:

Scope  (14)

Data  (8)

By default, colors change with argument from (cyan) to (red) to (cyan):

By default, colors are lighter for complex numbers with larger moduli:

Unknown, symbolic or missing values are shown dark red:

Specify explicit colors for cells:

Plot a ragged array, padding on the right:

Cells with value None are rendered like the background:

Plot a sparse array:

Plot a numeric array:

Presentation  (6)

Add a mesh:

Add a legend:

Turn off the default shading:

Change the color function:

Use shading schemes like ComplexPlot:

Choose a color function and a shading scheme:

Options  (71)

AspectRatio  (4)

By default, the ratio of the height to width for the plot is determined automatically:

Use numerical value to specify the height to width ratio:

Make the height the same as the width with AspectRatio1:

AspectRatioFull adjusts the height and width to tightly fit inside other constructs:

Axes  (4)

By default, ComplexArrayPlot uses a frame instead of axes:

Use axes instead of a frame:

Use AxesOrigin to specify where the axes intersect:

Turn each axis on individually:

AxesLabel  (3)

No axes labels are drawn by default:

Place a label on the axis:

Specify axes labels:

AxesOrigin  (2)

The position of the axes is determined automatically:

Specify an explicit origin for the axes:

AxesStyle  (4)

Change the style of the axes:

Specify a style for each axis:

Use different styles for the ticks and the axes:

Use different styles for the labels and the axes:

Background  (4)

Background is normally visible only around the edges:

The background "shows through" whenever an explicit entry is None:

Background also by default shows through for values outside the plot range:

ClippingStyle overrides background color:

ClippingStyle  (3)

The default is to show values of with values outside the TemplateBox[{z}, Abs] plot range in the background color:

Show values outside the plot range in red:

Show low values in black and high values in red:

ColorFunction  (9)

By default, complex values are colored by Arg[z] and shaded by Abs[z]:

Turn off the shading based on Abs[z]:

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

Use a pure function as the color function:

Use a named color gradient from ColorData:

Specify a shading scheme:

Specify a color function and a shading scheme:

With ColorFunctionScalingTrue, the values are first scaled to lie between 0 and 1:

Use a color function that colors complex values by Re[z], Im[z], Abs[z] or Arg[z]:

ColorFunctionScaling  (3)

By default, values are scaled to lie between 0 to 1 before applying the color function:

Choose to not scale the argument prior to applying the color function:

Some color functions are not cyclic so the colors only change in a small band:

ColorRules  (6)

Specify color rules for explicit values:

Specify color rules for patterns:

ColorFunction is used if no color rules apply:

The array can contain symbolic values:

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

Rules are used in the order given:

DataRange  (5)

By default, data is plotted at integer coordinates:

Specify a range for the data:

Specify a range for the data with a pair of complex numbers:

Specify the bottom-left corner of the data range:

Specify the top-right corner of the data range:

DataReversed  (4)

Reverse the order of rows:

The frame ticks give the original row numbers:

Reverse the order of rows and columns:

Reverse the order of columns:

Epilog  (3)

Use Epilog to superimpose other graphics:

Epilog uses the standard Graphics coordinate system:

The graphics can be translucent:

MaxPlotPoints  (1)

Use MaxPlotPoints to limit the number of elements explicitly plotted in each direction:

Mesh  (4)

Insert mesh lines between all cells:

Insert 1 row mesh line and 3 column mesh lines:

Insert mesh lines around the first 4 columns:

Specify styles for the mesh lines:

MeshStyle  (2)

Style the mesh lines:

Style the row lines differently than the column lines:

PlotLegends  (5)

No legend is used by default:

Generate a legend automatically:

PlotLegends automatically picks up a named ColorFunction:

PlotLegends does not pick up a user-defined ColorFunction, but the user can still construct an appropriate legend:

Use Placed to change the location of the legend:

PlotRange  (4)

Plot all elements:

Plot values of for which 1Abs[z]2:

Plot values of for which Abs[z]2:

The first two entries in PlotRange specify the range of rows and columns to include:

PlotTheme  (1)

Use a theme with detailed ticks and a legend:

Move the legend below the plot:

Applications  (18)

Fourier Transforms  (6)

Generate a pure discrete two-dimensional sinusoid:

Compute the two-dimensional Fourier transform:

Display the original data and its Fourier transform. In the second plot, the bright square in row 4 and column 6 (measured from the top-left corner) tells us that the corresponding frequencies are 3 and 5, respectively:

Generate a linear combination of discrete sinusoids:

Identify the component frequencies in the Fourier transform:

Display two-dimensional data and its Fourier transform:

Use ColorRules to threshold a Fourier transform:

Display only the top-left quarter of the Fourier transform:

Model the intensity of light diffracted by a small circular aperture:

Display the diffraction pattern and its Fourier transform:

Create data and modify it by shifting the columns left:

The magnitude of Fourier transforms are graphed, but that does not reveal potentially useful phase information. Observe the extra information in the middle plot:

Note the change in the ComplexArrayPlot and the lack of change in the ArrayPlot of the Fourier transform:

Matrix Representations  (3)

Plot a sparse matrix with complex entries:

Plot a random complex-valued matrix:

Visually verify that the matrix is diagonalized:

Visualize the matrices in a matrix factorization:

Visually compare Kronecker products:

Basins of Attraction  (2)

Define a complex valued function with roots at 1, ±2π /3:

Compute the corresponding Newton map:

Compute approximations to the roots of for various starting values:

Display the basins of attraction:

Define a complex-valued function with an infinite number of roots, ,:

Compute the corresponding Newton map:

Note that the roots only have three distinct argument values, and :

Compute approximations to the roots of for various starting values:

Display the basins of attraction, using shading to highlight the dependence on the modulus of the roots:

Define a complex-valued function with roots at 1, ±2π /3:

Newton's method has quadratic convergence, but Halley's method has cubic convergence:

Compute approximations to the roots of for various starting values:

Display the basins of attraction for Halley's method:

Matrix Spectra  (2)

Display eigenvalues from a two-parameter family of matrices:

Define a matrix:

Compute its eigenvalues:

The ϵ-pseudospectrum of the matrix is the set of values in the complex plane for which the norm of (m-λ I)-1 is greater than 1/(epsilon). Graph the ϵ-pseudospectra for ϵ=1,1/2,1/4,1/8,1/16,1/32 and note the eigenvalues at the white dots:

If the largest eigenvalue is used instead of the norm of (m-λ I)-1, then argument information can be added:

Create a Toeplitz matrix:

Make a plot similar to an ϵ-pseudospectral plot:

Use a named matrix:

Make a graph similar to a spectral portrait:

Iterated Systems  (3)

Visualize complex cellular automata:

Compute iterates of a complex-valued function:

Display the data on a width of 10:

The iterates appear to converge for a different constant:

Iterates are periodic for carefully chosen constants:

Let be the logistic function with a complex coefficient . Consider the sequence , for . Approximate the values of for which is unbounded and visualize the region:

Miscellaneous  (2)

Highlight Gaussian primes in black:

Plot a Fourier matrix:

Highlight the purely real and purely imaginary entries in black and gray, respectively:

Properties & Relations  (5)

ComplexArrayPlot colors complex values by their arguments and shades by their moduli like ComplexPlot:

ComplexArrayPlot is similar to ArrayPlot and MatrixPlot applied to the arguments of the complex values:

Grid arranges elements the same way as ComplexArrayPlot:

Raster arranges elements upside down relative to ComplexArrayPlot:

ArrayPlot3D can be used for 3D arrays of data:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_complexarrayplot, author="Wolfram Research", title="{ComplexArrayPlot}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ComplexArrayPlot.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_complexarrayplot, organization={Wolfram Research}, title={ComplexArrayPlot}, year={2020}, url={https://reference.wolfram.com/language/ref/ComplexArrayPlot.html}, note=[Accessed: 22-November-2024 ]}