グラフィックス関数に与えるオプションで,プロットに含める座標の範囲を指定する.
PlotRange
グラフィックス関数に与えるオプションで,プロットに含める座標の範囲を指定する.
詳細
- PlotRangeは,2Dおよび3Dのグラフィックスに使用することができる.
- 以下の設定を使用することができる.
-
All すべての点を含む Automatic 範囲外の点を落とす Full もとのデータの全範囲を含む max 各関数(以下参照)の明示的な限界 {min,max} y(2D),z(3D),配列の値の明示的な限界 {{xmin,xmax},{ymin,ymax}} x と y の明示的な限界 {{xmin,xmax},{ymin,ymax},{zmin,zmax}} x,y,z(3D)の明示的な限界 - 特定の座標について境界が明示されていない場合,Automaticの設定を前提とする.
- Automatic設定では,座標の値の分布が見出され,この分布から十分遠く外れた点は落とされる.このような点は往々にしてプロットされる関数の特異点の結果作成されたものである.
- 任意の明示的な限界あるいは{min,max}のペアを,AllあるいはAutomaticの指定で置き換えることができる.
- {min,Automatic}のような設定は,座標の特定の最小値を指定し,最大値が自動的に決定されることを指定している.
- 特定の極大や極小が{Automatic,α}を使って指定されたときは,実質的に,範囲はプロット中の点に対する割合 α を超えたところで切断されなければならない.滑らかな曲線や曲面が描画された場合,点の測定は投影された長さや面積に基づく.
- Plotおよび関連関数で,関数をプロットするためにもとの入力で決められた範囲を使うように指定するのにFullの設定を使うことができる. »
- Plot[f,{x,xmin,xmax},PlotRange->Full]とすると,指定された範囲で f の実際の値がプロットされない部分があっても全範囲{xmin,xmax}が使われる.
- PlotRange->s の設定のときは,以下の範囲が使われる. »
-
Graphics {{-s,s},{-s,s}} Graphics3D {{-s,s},{-s,s},{-s,s}} Plot {Full,{-s,s}} ListPlot および ListLinePlot {Full,{0,s}} ParametricPlot および RegionPlot {{-s,s},{-s,s}} ContourPlot および ListContourPlot {Full,Full,{-s,s}} DensityPlot および ListDensityPlot {Full,Full,{-s,s}} ArrayPlot {Full,Full,{0,s}} SpectrogramおよびCepstrogram {Full,{0,s},Full} Plot3D および ListPlot3D {Full,Full,{-s,s}} ListSurfacePlot3D {{-s,s},{-s,s},{-s,s}} ParametricPlot3D および RegionPlot3D {{-s,s},{-s,s},{-s,s}} ContourPlot3D および ListContourPlot3D {Full,Full,Full,{-s,s}} - AbsoluteOptionsは,Automaticが設定されている場合,PlotRangeの明示された形式の指示を与える.
- プロットに含める座標の最終的な絶対範囲はPlotRange自体およびPlotRangePaddingによって決定される.
例題
すべて開く すべて閉じる例 (3)
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]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]スコープ (8)
通常は,プロット関数は範囲外の点を使わないが,これは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とすると,すべての点が表示される:
Plot[1 / x, {x, 0.01, 1}, PlotRange -> All]Plot3D[Exp[-x ^ 2 - y ^ 2], {x, -4, 4}, {y, -4, 4}, PlotRange -> All]GraphicsとGraphics3DのPlotRangeは,デフォルトでAllである:
{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]}PlotRange->Automaticにして範囲外の点を除く:
Graphics[Point[Table[{x, 1 / x}, {x, .01, 1, .01}]], AspectRatio -> 1 / GoldenRatio, Axes -> True, PlotRange -> Automatic]PlotRange->Allを使ってすべての点が含まれるようにする:
{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]}PlotRange->Fullを使ってすべての点ともとの領域が含まれるようにする:
{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]}{min,max}を使って各方向に明示的な範囲を与えることができる:
Plot[Sin[x], {x, 0, 10}, PlotRange -> {0, .8}]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotRange -> {0, .8}]明示的な範囲の値の1つはAllやAutomaticのような記号でもよい:
Plot[Sin[x], {x, 0, 10}, PlotRange -> {0, All}]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotRange -> {Automatic, 0}]PlotRange->max の解釈は関数に依存する:
{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]}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}}]アプリケーション (1)
特性と関係 (7)
ClippingStyleを使って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]通常のグラフィックスでは,オブジェクトはプロット範囲を超えて拡張できる:
Graphics[{Pink, Disk[]}, PlotRange -> {{-.8, .8}, {0, 1}}, Frame -> True]PlotRangeClipping->Trueとすると,範囲に収まるようにオブジェクトが切り取られる:
Graphics[{Pink, Disk[]}, PlotRange -> {{-.8, .8}, {0, 1}}, Frame -> True, PlotRangeClipping -> True]ParametricPlot[r{Cos[θ], Sin[θ]}, {r, 0, 1}, {θ, 0, Pi}, PlotRange -> {{-.8, .8}, {0, 1}}]Graphics[{Pink, Rectangle[]}, Frame -> True]Graphics3D[Cuboid[]]PlotRangePaddingをNoneにして充填が行われないようにする:
Graphics[{Pink, Rectangle[]}, PlotRangePadding -> None, Frame -> True]Graphics3D[Cuboid[], PlotRangePadding -> None]Graphics[{Pink, Rectangle[]}, PlotRangePadding -> 1, Frame -> True]Graphics3D[Cuboid[], PlotRangePadding -> 1]Graphics[{Pink, Rectangle[]}, PlotRange -> {{0, 1}, {0, 1}}, Frame -> True]スケールされた(Scaled)座標はプロット範囲との割合で与えられる:
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]おもしろい例題 (3)
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]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]テクニカルノート
関連するガイド
履歴
1988 で導入 (1.0) | 2007 で更新 (6.0) ▪ 2017 (11.2)
テキスト
Wolfram Research (1988), PlotRange, Wolfram言語関数, https://reference.wolfram.com/language/ref/PlotRange.html (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: 27-November-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: 27-November-2026]}