LogLogPlot

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

generates a log-log plot of f as a function of x from xmin to xmax.

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

plots several functions fi.

LogLogPlot[{,w[fi],},]

plots fi with features defined by the symbolic wrapper w.

LogLogPlot[,{x}reg]

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

Details and Options

  • LogLogPlot makes power-law functions appear as straight lines. It allows very small or very large value changes to be seen over very large domains.
  • LogLogPlot effectively generates a curve in which Log[f] is plotted against Log[x], but with tick marks indicating the original values of f and x. It visualizes the set .
  • Gaps are left at any x where the fi evaluate to anything other than positive real numbers or
    Quantity.
  • The limits xmin and xmax can be real numbers or Quantity expressions.
  • The region reg can be any RegionQ object in 1D.
  • LogLogPlot treats the variable x as local, effectively using Block.
  • LogLogPlot has 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.
  • 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
  • LogLogPlot has the same options as Graphics, with the following additions and changes:
  • AspectRatio1/GoldenRatioratio of height to width
    AxesTruewhether to draw axes
    ClippingStyle Nonewhat to draw where curves are clipped
    ColorFunction Automatichow to determine the coloring of curves
    ColorFunctionScaling Truewhether to scale arguments to ColorFunction
    PlotLabel Noneoverall label for the plot
    PlotLabels Nonelabels to use for curves
    EvaluationMonitor Noneexpression to evaluate at every function evaluation
    Exclusions Automaticpoints in x to exclude
    ExclusionsStyle Nonewhat to draw at excluded points
    Filling Nonefilling to insert under each curve
    FillingStyle Automaticstyle to use for filling
    LabelingSize Automaticmaximum size of callouts and labels
    MaxRecursion Automaticthe maximum number of recursive subdivisions allowed
    Mesh Nonehow many mesh points to draw on each curve
    MeshFunctions {#1&}how to determine the placement of mesh points
    MeshShading Nonehow to shade regions between mesh points
    MeshStyle Automaticthe style for mesh points
    MethodAutomaticthe method to use for refining curves
    PerformanceGoal $PerformanceGoalaspects of performance to try to optimize
    PlotLegends Nonelegends for curves
    PlotPoints Automaticinitial number of sample points
    PlotRange {Full,Automatic}the range of y or other values to include
    PlotRangeClippingTruewhether to clip at the plot range
    PlotStyle Automaticgraphics directives to specify the style for each curve
    PlotTheme $PlotThemeoverall theme for the plot
    RegionFunction (True&)how to determine whether a point should be included
    ScalingFunctions Nonehow to scale individual coordinates
    TargetUnitsAutomaticunits to display in the plot
    WorkingPrecisionMachinePrecisionthe precision used in internal computations
  • 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
  • Possible settings for PlotLayout that show single curves in multiple plot panels include:
  • "Column"use separate curves in a column of panels
    "Row"use separate curves in a row of panels
    {"Column",k},{"Row",k}use k columns or rows
    {"Column",UpTo[k]},{"Row",UpTo[k]}use at most k columns or rows
  • With the default settings Exclusions->Automatic and ExclusionsStyle->None, LogLogPlot 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,}.
  • PlotLegends->"Expressions" uses the fi as the legend text.
  • LogLogPlot 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 LogLogPlot 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.
  • Possible settings for ScalingFunctions include:
  • syscale the y axis
    {sx,sy}scale x and y axes
  • Common built-in scaling functions s include:
  • "Log"log scale with automatic tick labeling
    "Log10"base-10 log scale with powers of 10 for ticks
    "SignedLog"log-like scale that includes 0 and negative numbers
    "Reverse"reverse the coordinate direction
    "Infinite"infinite scale
  • If a scaling function is specified for either direction, it is applied after the normal log scaling.

Examples

open allclose all

Basic Examples  (4)

Powers show up as straight lines on a log-log plot:

Plot several functions with legends:

Label each curve:

Fill between curves:

Scope  (27)

Sampling  (7)

More points are sampled when the function changes quickly:

The plot range is selected automatically:

Ranges where the function becomes negative are excluded:

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

Use PlotPoints and MaxRecursion to control adaptive sampling:

Use PlotRange to focus in on areas of interest:

Use Exclusions to remove points or split the resulting curve:

Labeling and Legending  (8)

Label curves with Labeled:

Place the labels relative to the curves:

Label curves with PlotLabels:

Place the label near the curve at an value:

Use a scaled position:

Specify the text position relative to the point:

Label curves automatically with Callout:

Place labels at specific locations:

Include legends for each curve:

Use Legended to provide a legend for a specific curve:

Use Placed to change the legend location:

Presentation  (12)

Multiple curves are automatically colored to be distinct:

Provide explicit styling to different curves:

Add labels:

Create legends from the functions:

Specify labels for legends:

Provide an interactive Tooltip for each curve:

Create filled plots:

Use a theme with a frame, grid lines, and an automatic legend:

Use a more vibrant theme:

Create an overlay mesh:

Style the curve segments between mesh points:

Show multiple curves in a row of separate panels:

Use a column instead of a row:

Use multiple rows or columns:

Use ScalingFunctions to reverse the y axis:

Scale both x and y axes:

Options  (84)

ClippingStyle  (5)

Omit clipped regions of the plot:

Show the clipped regions like the rest of the curve:

Show clipped regions with red lines:

Show clipped regions as thick at the bottom and red at the top:

Show clipped regions as red and thick:

ColorFunction  (5)

Color by scaled coordinate and scaled coordinate, respectively:

Color a curve red when its absolute coordinate is above 1:

Fill with the color used for the curve:

ColorFunction has higher priority than PlotStyle for coloring the curve:

Use a color function that is red at powers of 10:

ColorFunctionScaling  (3)

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

Scaling is done on a linear scale in the original coordinates:

Use a color function that is red at powers of 10:

EvaluationMonitor  (3)

Find the list of values sampled by LogLogPlot:

Show where LogLogPlot evaluates the function:

Count how many times the function is evaluated:

Exclusions  (2)

Use automatic methods for computing exclusions, in this case for a piecewise function:

Indicate that no exclusions should be computed:

ExclusionsStyle  (2)

Use dashed lines to indicate the vertical asymptotes:

Use blue points to highlight the exclusions:

Filling  (7)

Use symbolic or explicit values:

Overlapping fills by default combine using opacity:

Fill between curve 1 and the axis:

Fill between curves 1 and 2:

Fill between curves 1 and 2 with a specific style:

Fill between curves 1 and 2; use yellow when 1 is below 2 and green when 2 is above 1:

Fill between curves 1 and with yellow:

FillingStyle  (4)

Use different fill colors:

Fill with opacity 0.5 yellow:

Fill with red below and blue above:

Use a variable filling style obtained from a ColorFunction:

LabelingSize  (4)

Textual labels are shown at their actual sizes:

Image labels are automatically resized:

Specify a maximum size for textual labels:

Specify a maximum size for image labels:

Show image labels at their natural sizes:

MaxRecursion  (2)

The default sampling mesh:

Each level of MaxRecursion will subdivide the initial mesh into a finer mesh:

Mesh  (3)

Show the initial and final sampling meshes:

Use 20 mesh levels evenly spaced in the unscaled direction:

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

MeshFunctions  (4)

Use a mesh evenly spaced in the and directions:

Mesh functions use the unscaled values in the and directions:

Use Log to scale the mesh functions:

Show 5 mesh levels in the direction (red) and 10 in the direction (blue):

MeshShading  (6)

Alternate red and blue segments of equal width in the direction:

Use None to remove segments:

MeshShading can be used with PlotStyle:

MeshShading has higher priority than PlotStyle for styling the curve:

Use PlotStyle for some segments by setting MeshShading to Automatic:

MeshShading can be used with ColorFunction:

MeshStyle  (4)

Color the mesh the same color as the plot:

Use a red mesh in the direction:

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

Use big red mesh points 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  (5)

Specify text to label curves:

Place the labels above the curves:

Place the labels differently for each curve:

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

Use callouts to identify the points:

Use None to not add a label:

PlotLayout  (2)

Place each curve in a separate panel using shared axes:

Use a row instead of a column:

Use multiple columns or rows:

Prefer full columns or rows:

PlotLegends  (7)

No legends are used by default:

Create a legend based on the functions:

Create a legend with placeholder text:

Specify labels for each curve:

PlotLegends picks up PlotStyle values automatically:

Use Placed to position legends:

Place legends inside:

Use LineLegend to modify the appearance of the legend:

PlotPoints  (1)

Use more initial points to get a smoother curve:

PlotRange  (1)

Show the curve only where it is positive:

PlotStyle  (6)

Use different style directives:

By default, different styles are chosen for multiple curves:

Explicitly specify the style for different curves:

PlotStyle can be combined with ColorFunction:

PlotStyle can be combined with MeshShading:

MeshStyle by default uses the same style as PlotStyle:

PlotTheme  (1)

Use a theme with a frame, grid lines, and an automatic legend:

Turn off the grid lines:

RegionFunction  (2)

Show the curve where :

Exclude the region where :

ScalingFunctions  (2)

By default, both axes have a log scale:

Reverse the direction of the y axis:

Reverse the direction of both axes:

Properties & Relations  (4)

LogLogPlot samples more points where it needs to:

LogLogPlot is a special case of Plot for curves:

Use LogPlot and LogLinearPlot for logarithmic plots in the other directions:

Use ListLogPlot for data:

Wolfram Research (2007), LogLogPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/LogLogPlot.html (updated 2022).

Text

Wolfram Research (2007), LogLogPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/LogLogPlot.html (updated 2022).

CMS

Wolfram Language. 2007. "LogLogPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/LogLogPlot.html.

APA

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

BibTeX

@misc{reference.wolfram_2022_loglogplot, author="Wolfram Research", title="{LogLogPlot}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/LogLogPlot.html}", note=[Accessed: 29-May-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_loglogplot, organization={Wolfram Research}, title={LogLogPlot}, year={2022}, url={https://reference.wolfram.com/language/ref/LogLogPlot.html}, note=[Accessed: 29-May-2023 ]}