is an option for graphics functions that specifies what range of coordinates to include in a plot.
PlotRange
is an option for graphics functions that specifies what range of coordinates to include in a plot.
Details
- PlotRange can be used for both two- and three-dimensional graphics.
- The following settings can be used:
-
All all points are included Automatic outlying points are dropped Full include full range of original data max explicit limit for each function (see below) {min,max} explicit limits for y (2D), z (3D), or array values {{xmin,xmax},{ymin,ymax}} explicit limits for x and y {{xmin,xmax},{ymin,ymax},{zmin,zmax}} explicit limits for x, y, and z (3D) - When no explicit limits are given for a particular coordinate, a setting of Automatic is assumed.
- With the Automatic setting, the distribution of coordinate values is found, and any points sufficiently far out in the distribution are dropped. Such points are often produced as a result of singularities in functions being plotted.
- Any explicit limit or pair {min,max} can be replaced by a specification such as All or Automatic.
- A setting such as {min,Automatic} gives a particular minimum value for a coordinate, with a maximum value to be determined automatically.
- If a particular minimum or maximum is specified as {Automatic,α}, this means that the range should in effect be cut off beyond a fraction α of points in the plot. When smooth curves or surfaces are plotted, the measure of points is based on projected length or area.
- The setting Full can be used in Plot and related functions to specify that a range determined by the original input to the plotting function should be used. »
- Plot[f,{x,xmin,xmax},PlotRange->Full] specifies that the full range {xmin,xmax} should be used, even if no actual values of f are plotted in part of that range.
- With the setting PlotRange->s, the following ranges are used: »
-
Graphics {{-s,s},{-s,s}} Graphics3D {{-s,s},{-s,s},{-s,s}} Plot {Full,{-s,s}} ListPlot and ListLinePlot {Full,{0,s}} ParametricPlot and RegionPlot {{-s,s},{-s,s}} ContourPlot and ListContourPlot {Full,Full,{-s,s}} DensityPlot and ListDensityPlot {Full,Full,{-s,s}} ArrayPlot {Full,Full,{0,s}} SpectrogramandCepstrogram {Full,{0,s},Full} Plot3D and ListPlot3D {Full,Full,{-s,s}} ListSurfacePlot3D {{-s,s},{-s,s},{-s,s}} ParametricPlot3D and RegionPlot3D {{-s,s},{-s,s},{-s,s}} ContourPlot3D and ListContourPlot3D {Full,Full,Full,{-s,s}} - AbsoluteOptions gives the explicit form of PlotRange specifications when Automatic settings are given.
- The final absolute range of coordinates to include in a plot is determined by PlotRangePadding as well as PlotRange itself.
Examples
open all close allBasic Examples (3)
Automatically drop outlying points:
Plot[Tan[x], {x, 0, 10}, PlotRange -> Automatic]Graphics[{Pink, Disk[]}, PlotRange -> {{-.5, .5}, {0, 1.5}}, PlotRangeClipping -> True, Frame -> True]Plot3D[x Exp[-x ^ 2 - y ^ 2], {x, -2, 2}, {y, -2, 2}, PlotRange -> {-.3, .3}, ClippingStyle -> None]Choose the range to show all the existing points:
Plot3D[Sqrt[1 - x ^ 2 - y ^ 2], {x, -2, 2}, {y, -2, 2}, PlotRange -> All]Plot3D[Sqrt[1 - x ^ 2 - y ^ 2], {x, -2, 2}, {y, -2, 2}, PlotRange -> Full]Scope (8)
Normally, plot functions drop outlying points, which is equivalent to PlotRange->Automatic:
{Plot[1 / x, {x, 0.01, 1}], Plot[1 / x, {x, 0.01, 1}, PlotRange -> Automatic]}{Plot3D[Exp[-x ^ 2 - y ^ 2], {x, -4, 4}, {y, -4, 4}], Plot3D[Exp[-x ^ 2 - y ^ 2], {x, -4, 4}, {y, -4, 4}, PlotRange -> Automatic]}PlotRange->All shows all of the points:
Plot[1 / x, {x, 0.01, 1}, PlotRange -> All]Plot3D[Exp[-x ^ 2 - y ^ 2], {x, -4, 4}, {y, -4, 4}, PlotRange -> All]PlotRange for Graphics and Graphics3D is All, by default:
{Graphics[Point[Table[{x, 1 / x}, {x, .01, 1, .01}]], AspectRatio -> 1 / GoldenRatio, Axes -> True], Graphics[Point[Table[{x, 1 / x}, {x, .01, 1, .01}]], AspectRatio -> 1 / GoldenRatio, Axes -> True, PlotRange -> All]}Drop outlying points, by setting PlotRange->Automatic:
Graphics[Point[Table[{x, 1 / x}, {x, .01, 1, .01}]], AspectRatio -> 1 / GoldenRatio, Axes -> True, PlotRange -> Automatic]Use PlotRange->All to include all points:
{Plot[Sqrt[1 - x ^ 2], {x, -2, 2}, PlotRange -> All], Plot3D[Sqrt[1 - x ^ 2 - y ^ 2], {x, -2, 2}, {y, -2, 2}, PlotRange -> All]}Use PlotRange->Full to include all the points and the original domain:
{Plot[Sqrt[1 - x ^ 2], {x, -2, 2}, PlotRange -> Full], Plot3D[Sqrt[1 - x ^ 2 - y ^ 2], {x, -2, 2}, {y, -2, 2}, PlotRange -> Full]}An explicit range can be given in each direction by {min,max}:
Plot[Sin[x], {x, 0, 10}, PlotRange -> {0, .8}]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotRange -> {0, .8}]One value of the explicit range can be a symbol such as All or Automatic:
Plot[Sin[x], {x, 0, 10}, PlotRange -> {0, All}]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotRange -> {Automatic, 0}]The interpretation of PlotRange->max depends on the function:
{Plot[Sin[x], {x, 0, 10}, PlotRange -> .8], Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotRange -> .8]}{Graphics[{Pink, Disk[]}, PlotRange -> .9, Axes -> True], Graphics3D[Sphere[], PlotRange -> .9, Axes -> True]}Any valid range specification can be given to each direction:
Plot[Sin[x], {x, 0, 10}, PlotRange -> {Full, All}]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotRange -> {Full, {1, 2}, {-.8, .8}}]Applications (1)
Properties & Relations (7)
Use ClippingStyle to style the region clipped by PlotRange:
Plot[Sin[x], {x, 0, 10}, PlotRange -> 1 / 2, ClippingStyle -> Pink]ContourPlot[Sin[x]Sin[y], {x, -Pi, Pi}, {y, -Pi, Pi}, PlotRange -> {{-Pi, Pi}, {-Pi, Pi}, {-1 / 2, 1 / 2}}, ClippingStyle -> Pink]Plot3D[Sin[x]Sin[y], {x, -Pi, Pi}, {y, -Pi, Pi}, PlotRange -> 1 / 2, ClippingStyle -> None]In ordinary graphics, objects can extend beyond the plot range:
Graphics[{Pink, Disk[]}, PlotRange -> {{-.8, .8}, {0, 1}}, Frame -> True]Use PlotRangeClipping->True to clip objects to the range:
Graphics[{Pink, Disk[]}, PlotRange -> {{-.8, .8}, {0, 1}}, Frame -> True, PlotRangeClipping -> True]Normally, plot functions clip objects to the range:
ParametricPlot[r{Cos[θ], Sin[θ]}, {r, 0, 1}, {θ, 0, Pi}, PlotRange -> {{-.8, .8}, {0, 1}}]By default, 2% of padding is added to the plot range in each direction:
Graphics[{Pink, Rectangle[]}, Frame -> True]Graphics3D[Cuboid[]]Prevent padding by setting PlotRangePadding to None:
Graphics[{Pink, Rectangle[]}, PlotRangePadding -> None, Frame -> True]Graphics3D[Cuboid[], PlotRangePadding -> None]Include 1 coordinate unit of padding on all sides:
Graphics[{Pink, Rectangle[]}, PlotRangePadding -> 1, Frame -> True]Graphics3D[Cuboid[], PlotRangePadding -> 1]No padding is added if the plot range is explicit:
Graphics[{Pink, Rectangle[]}, PlotRange -> {{0, 1}, {0, 1}}, Frame -> True]Scaled coordinates are given by fractions of the plot range:
Graphics[Rectangle[Scaled[{0, .4}], Scaled[{1, .6}]], Frame -> True, PlotRange -> {{0, 10}, {0, 10}}]Graphics3D[Cuboid[Scaled[{0, .2, .4}], Scaled[{1, .8, .6}]], PlotRange -> {{0, 10}, {0, 10}, {0, 10}}, Axes -> True]Neat Examples (3)
An elementary function with pole singularities:
Plot3D[Im[Sec[(x + I y) ^ 3]], {x, -2, 2}, {y, -2, 2}, PlotStyle -> Directive[Purple, Specularity[White, 20], Opacity[0.8]], Mesh -> None, ClippingStyle -> Automatic, PlotRange -> Automatic]A function with a curve singularity:
Plot3D[Tan[y ^ 2 - x ^ 3 + x - 1 / 2], {x, -2, 2}, {y, -2, 2}, Exclusions -> {Cos[y ^ 2 - x ^ 3 + x - 1 / 2] == 0}, PlotPoints -> 25, Mesh -> None, PlotStyle -> Directive[Pink, Specularity[White, 20], Opacity[0.8]], PlotRange -> Automatic]ContourPlot[Evaluate[Sum[Product[Norm[{x, y} - RandomReal[{-3, 3}, {2}]], {i, j}] / Product[Norm[{x, y} - RandomReal[{-3, 3}, {2}]], {i, j}], {j, 1, 5}]], {x, -5, 5}, {y, -5, 5}, Contours -> 50, ColorFunction -> (Hue[#]&), ClippingStyle -> None, FrameTicks -> None, PlotRange -> Automatic]Tech Notes
History
Introduced in 1988 (1.0) | Updated in 2007 (6.0) ▪ 2017 (11.2)
Text
Wolfram Research (1988), PlotRange, Wolfram Language function, https://reference.wolfram.com/language/ref/PlotRange.html (updated 2017).
CMS
Wolfram Language. 1988. "PlotRange." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/PlotRange.html.
APA
Wolfram Language. (1988). PlotRange. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PlotRange.html
BibTeX
@misc{reference.wolfram_2026_plotrange, author="Wolfram Research", title="{PlotRange}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/PlotRange.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_plotrange, organization={Wolfram Research}, title={PlotRange}, year={2017}, url={https://reference.wolfram.com/language/ref/PlotRange.html}, note=[Accessed: 12-June-2026]}