AbsArgPlot

AbsArgPlot[f,{x,xmin,xmax}]

generates a plot of Abs[f] colored by Arg[f] as a function of x from xmin to xmax.

AbsArgPlot[{f1,f2,},{x,xmin,xmax}]

plots several functions.

AbsArgPlot[{,w[fi],},]

plots fi with features defined by the symbolic wrapper w.

AbsArgPlot[,{x}reg]

takes the variable x to be in the geometric region reg.

Details and Options

  • AbsArgPlot evaluates f at different values of x to create smooth curves of the form {x,Abs[f[x]]} colored by {x,Arg[f[x]]}.
  • Gaps are left at any x where the fi evaluate to non-numeric values.
  • The region reg can be any RegionQ object in 1D.
  • AbsArgPlot treats the variable x as local, effectively using Block.
  • AbsArgPlot has the attribute HoldAll and evaluates f only after assigning specific numerical values to x.
  • In some cases, it may be more efficient to use Evaluate to evaluate f symbolically before specific numerical values are assigned to x.
  • Wrappers apply to both Re[f] and Im[f].
  • The following wrappers w can be used for the fi:
  • Annotation[fi,label]provide an annotation for the fi
    Button[fi,action]evaluate action when the curve for fi is clicked
    Callout[fi,label]label the function with a callout
    Callout[fi,label,pos]place the callout at relative position pos
    EventHandler[fi,events]define a general event handler for fi
    Hyperlink[fi,uri]make the function a hyperlink
    Labeled[fi,label]label the function
    Labeled[fi,label,pos]place the label at relative position pos
    Legended[fi,label]identify the function in a legend
    PopupWindow[fi,cont]attach a popup window to the function
    StatusArea[fi,label]display in the status area on mouseover
    Style[fi,styles]show the function using the specified styles
    Tooltip[fi,label]attach a tooltip to the function
    Tooltip[fi]use functions as tooltips
  • Wrappers w can be applied at multiple levels:
  • w[fi]wrap the fi
    w[{f1,}]wrap a collection of fi
    w1[w2[]]use nested wrappers
  • Callout, Labeled and Placed can use the following positions pos:
  • Automaticautomatically placed labels
    Above, Below, Before, Afterpositions around the curve
    xnear the curve at a position x
    Scaled[s]scaled position s along the curve
    {s,Above},{s,Below},relative position at position s along the curve
    {pos,epos}epos in label placed at relative position pos of the curve
  • AbsArgPlot has the same options as Plot.
  • Possible settings for ClippingStyle are:
  • Automaticuse a dotted line for the clipped portion
    Noneomit the clipped portion of the curve
    styleuse style for the clipped portion
  • With the default settings Exclusions->Automatic and ExclusionsStyle->None, AbsArgPlot breaks curves at discontinuities and singularities it detects. Exclusions->None joins across discontinuities and singularities.
  • Exclusions->{x1,x2,} is equivalent to Exclusions->{x==x1,x==x2,}.
  • PlotLabels->"Expressions" uses the fi as the label text.
  • AbsArgPlot initially evaluates f at a number of equally spaced sample points specified by PlotPoints. Then it uses an adaptive algorithm to choose additional sample points, subdividing a given interval at most MaxRecursion times.
  • Since only a finite number of sample points are used, it is possible for AbsArgPlot to miss features of f. Increasing the settings for PlotPoints and MaxRecursion will often catch such features.
  • Themes that affect curves include:
  • "ThinLines"thin plot lines
    "MediumLines"medium plot lines
    "ThickLines"thick plot lines
  • The arguments supplied to functions in MeshFunctions and RegionFunction are x, y. Functions in ColorFunction are by default supplied with scaled versions of these arguments.
  • ScalingFunctions->"scale" scales the coordinate; ScalingFunctions{"scalex","scaley"} scales both the and coordinates.

Examples

open allclose all

Basic Examples  (6)

Plot the modulus of a complex function of a real variable colored by its argument:

Plot several functions:

Label each curve:

Include a legend:

Fill below a curve:

Compare Plot and AbsArgPlot:

Scope  (15)

Sampling  (7)

More points are sampled where the function changes quickly:

The plot range is selected automatically:

The curve is split when there are discontinuities in the function:

Use Exclusions->None to draw connected curves:

Use PlotPoints and MaxRecursion to control adaptive sampling:

The domain can be specified by a region:

Specify a domain using a MeshRegion:

Labeling and Legending  (3)

The Automatic legend shows the range of Arg values:

Explicitly label the individual curves:

Identify curves with wrappers:

Presentation  (5)

Provide explicit styling to different curves:

Add labels and a legend:

Create filled plots:

Use a plot theme:

Use ScalingFunctions to scale the axes:

Options  (47)

ClippingStyle  (2)

Omit clipped regions of the plot:

Show clipped regions with black lines:

ColorFunction  (4)

Color by the scaled argument:

Use a named color gradient:

ColorFunction has higher priority than PlotStyle:

Highlight part of the plot:

ColorFunctionScaling  (1)

No argument scaling on the left; automatic scaling on the right:

Exclusions  (3)

Use automatic methods for computing exclusions:

Exclusions are automatically computed for both Abs and Arg:

Indicate that no exclusions should be computed:

ExclusionStyle  (1)

Use gray lines to connect portions of the curve and black points to indicate exclusions:

Filling  (4)

Use symbolic or explicit values:

Filling uses transparent colors if more than one curve is specified:

Fill between curve 1 and the axis:

Fill between curves 1 and 2:

FillingStyle  (2)

Use different fill colors:

Fill between two curves with red below the second curve and blue above:

MaxRecursion  (1)

Each level of MaxRecursion adaptively subdivides the initial mesh into a finer mesh:

Mesh  (3)

Show the initial and final sampling meshes:

Use 10 mesh points evenly spaced in the direction:

Use an explicit list of values for the mesh in the direction:

MeshFunctions  (2)

Use a mesh evenly spaced in the and directions:

Show 10 mesh levels in the direction (black) and 6 in the direction (red):

MeshShading  (2)

Remove segments of the curve:

MeshShading has higher priority than PlotStyle for styling:

MeshStyle  (2)

Use a black mesh in the direction:

Use a black mesh in the direction and a red mesh in the direction:

PerformanceGoal  (2)

Generate a higher-quality plot:

Emphasize performance, possibly at the cost of quality:

PlotLabel  (1)

Add an overall label to the plot:

PlotLabels  (6)

Specify text to label curves:

Modify the appearance of the labels:

Place the labels differently for each curve:

PlotLabels->"Expressions" uses functions as curve labels:

Use callouts to identify the curves:

Use None to not add a label:

PlotLegends  (2)

Create a legend for the argument color:

Create multiple legends:

PlotPoints  (1)

Use more initial points to get smoother curves:

PlotRange  (1)

The plot range is selected automatically:

Focus on a specified range of values:

PlotStyle  (2)

PlotStyle can be used to style curves:

The coloring of the argument takes precedence over colors specified with PlotStyle:

PlotTheme  (1)

Use a theme:

RegionFunction  (1)

Show the curve where :

ScalingFunctions  (3)

By default, plots have linear scales in each direction:

Use a logarithm to scale the modulus but leave the argument (color) unscaled:

Use different scales in the and directions:

Applications  (3)

Plot Fourier transforms:

Plot the solution of a complex differential equation with initial conditions:

The colors are rescaled since the argument never exceeds 1 in magnitude:

Graph special functions:

Properties & Relations  (8)

AbsArgPlot is a special case of Plot:

ComplexPlot shows the argument and magnitude of a function using color:

Use ComplexPlot3D to use the axis for the magnitude:

Use ReImPlot to plot real and imaginary components over the real numbers:

Use ComplexListPlot to show the location of complex numbers in the plane:

ComplexContourPlot plots curves over the complexes:

ComplexRegionPlot plots regions over the complexes:

ComplexStreamPlot and ComplexVectorPlot treat complex numbers as directions:

Possible Issues  (2)

An apparent lack of color change does not mean that the argument value does not change:

Mesh points that coincide with argument exclusions may be missing:

Introduced in 2019
 (12.0)