Inset
詳細とオプション
- Insetは,GraphicsおよびGraphics3Dで使うことができる.
- インタラクティブな操作では,Inset[obj,…]はデフォルトで単一ユニットとして選ばれる.内部の個々の要素を選択する場合にはダブルクリックしなければならない.
- オブジェクト obj はグラフィックス,セル式,文字列,その他の式のいずれでもよい.
- Graphics3Dに挿入されたオブジェクトは,3Dグラフィックスが回転される間は掲示板として表示される.
- 位置は以下で指定できる.
-
{x,y} プロット中の通常の座標 Scaled[{x,y},…] 0から1までスケールされた座標 ImageScaled[{x,y},…] 画像全体を0から1にスケールした座標 Offset[{dx,dy},…] 印刷用ポイント数による絶対オフセット Center等 {Center,Center}等 {valx,valy,valz} 3Dグラフィックスでの座標
座標が取り得るのは,数字,AutomaticあるいはLeft,Center,Right,Axisである.
座標が取り得るのは,数字,AutomaticあるいはTop,Center,Bottom,Baseline,Axisである.- Axisはプロット中の軸の位置かタイプセットされたテキストの中心線に相当する.
- Centerは画像全体の中心位置に相当する.
- Inset[obj]はInset[obj,Center]に等しい.
- opos のデフォルト値は,obj のAlignmentPointオプションの設定値であるか,デフォルトの obj の境界ボックスの中心である.
- size がAutomaticのとき,取込みは自然な大きさで行われる.
-
グラフィックス ImageSizeの設定値で決定される タイプセット式 折り返しなしの絶対的な大きさ - {w,Automatic}の size はタイプセット式が幅 wで折り返されるように指定する.
- size が{w,h}として与えられると,縦横比が一定ではないオブジェクト obj は厳密に w×h の矩形になるように水平方向か垂直方向に伸張される.
- obj が固定の縦横比を持ったオブジェクトである場合は,厳密な縦横比になるようにオブジェクトが伸張されたであろう方向の両側に空白スペースが均等に残される.
- オプションBackgroundの設定値は,はめ込みの領域全体に渡る背景の指定に使われる.
- デフォルトで,挿入物の
方向と
方向が囲い込んでいるグラフィックスの
方向と
方向に揃うように揃えられる. - Inset[…,dirs]は違う揃え方を指定するのに使うことができる.
- dirs が取り得る値
-
Automatic デフォルトの揃え方 {xx,xy} {xx,xy}に沿った
方向{Automatic,{yx,yy}} {yx,yy}に沿った
方向{{xx,xy},{yx,yy}} {xx,xy} と{yx,yy}に沿った
と
の方向None Insetのコンテンツの方向を決して変えない
方向だけあるいは
方向だけを指定すると,一般にはめ込みが厳密に回転する.
と
の両方向を指定すると,一般に回転とせん断が起る.ここで,もとのはめ込まれた長方形は与えられた方向のベクトルによる平行四辺形になる.- ベクトル{xx,xy}とベクトル{yx,yy}の方向だけが重要である.はめ込まれるもののスケールは{w,h}で決められる.
- dirs をNoneと指定すると,obj の
方向が常に水平に保たれる. - dirs を{Automatic,None}と指定すると,
方向が常に垂直に保たれる. - Inset[Graphics3D[…],{x,y}]が2Dグラフィックスに現れた場合,Graphics3Dの整列点の投影,あるいは,デフォルトで,その2D境界ボックスの中心は,2Dグラフィックスの位置{x,y}に置かれる.
- Inset[Graphics3D[…],{x,y,z},{ox,oy}]は,オブジェクトの2D投影における位置{ox,oy}が位置{x,y,z}になるように指定する.
- 2Dグラフィックスは,常に,3Dグラフィックスの表示平面と平行であるとみなされる.
- Insetには次のオプションを与えることができる.
-
Alignment Left 挿入した内容をどのように並べるか Background None 取込みの範囲全体に使う背景 BaseStyle {} 挿入したコンテンツに使うベーススタイル ContentSelectable Automatic コンテンツの選択を許容するかどうか FormatType Automatic テキストのフォーマットタイプ - Background->Automaticとすると,挿入先のグラフィックス全体に指定されている背景色が,それがどのようなものであれ使われる.
- サイズ指定には,Scaled,ImageScaled,Offsetの形式を使うことができる.
例題
すべて開く すべて閉じる例 (4)
Graphics[{StandardOrange, Disk[], Inset[Plot[Tan[x], {x, -3, 3}]]}]Graphics[{Circle[], Inset[x ^ 2 + y ^ 2 == 1, {0, 0}]}]Plot[Sin[x], {x, 0, 10}, Epilog -> Inset[Graphics3D[Cylinder[], ImageSize -> 60, Boxed -> False], {0.5, Center}]]Graphics3D[{Sphere[{0, -1, 0}, 0.5], Cuboid[{-0.25, 0.5, -0.25}, {0.25, 1, 0.25}], Inset[Graphics[{StandardOrange, Disk[{0, 0}, .25]}, ImageSize -> 50], {0, 0, 0}]}, PlotRange -> 2]スコープ (20)
位置 (6)
デフォルトで,Centerは位置に使用される:
{Graphics[{Inset["ABCDEF"], Circle[]}, Axes -> True, Ticks -> None],
Graphics[{Inset["ABCDEF", Center], Circle[]}, Axes -> True, Ticks -> None]}Graphics[{Inset["ABCDEF", Automatic], Circle[]}, Axes -> True, Ticks -> None]Graphics[{Inset[x ^ 2 + y ^ 2 == 1, {0, .5}], Circle[]}, Frame -> True]Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}], Sphere[]}, Axes -> True]スケールされた(Scaled)座標を使う:
Graphics[{Inset[x ^ 2 + y ^ 2 == 1, Scaled[{.5, .25}]], Circle[]}, Frame -> True]Graphics3D[{Opacity[.5], Inset["ABCDEF", Scaled[{.5, .5, 0.25}]], Sphere[]}, Axes -> True]ImageScaledは充填も含めた画像全体の座標を指定する:
Framed@Graphics[{Inset[x ^ 2 + y ^ 2 == 1, ImageScaled[{.5, .5}]], Circle[]}, ImagePadding -> {{0, 50}, {0, 0}}]Offset座標を使う:
Graphics[{Inset[x ^ 2 + y ^ 2 == 1, Offset[{10, 20}, {0, 0}]], Circle[]}]Table[Graphics[{Inset["ABCDEF", {s, Center}], Circle[]}], {s, {Left, Center, Right}}]Table[Graphics[{Inset["ABCDEF", {Center, s}], Circle[]}], {s, {Top, Center, Bottom}}]整列 (4)
デフォルトで,Centerは整列位置に使われる:
{Graphics[{Inset["ABCDEF", {0, 0}], Circle[]}, Axes -> True, Ticks -> None],
Graphics[{Inset["ABCDEF", {0, 0}, Center], Circle[]}, Axes -> True, Ticks -> None]}Graphics[{Inset["ABCDEF", {0, 0}, Automatic], Circle[]}, Axes -> True, Ticks -> None]{Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}], Sphere[]}, Axes -> True], Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}, Automatic], Sphere[]}, Axes -> True], Graphics3D[{Opacity[.5], Inset["ABCDEF", {0, 0, 0}, Center], Sphere[]}, Axes -> True]}Table[Graphics[{Inset["ABCDEF", {0, 0}, {p, Center}], Circle[]}, Axes -> {False, True}, Ticks -> None], {p, {Right, Center, Left}}]Table[Graphics[{Inset["ABCDEF", {0, 0}, {Center, p}], Circle[]}, Axes -> {True, False}, Ticks -> None], {p, {Top, Center, Bottom}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, {p, Center}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {Right, Center, Left}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, {Center, p}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {Top, Center, Bottom}}]g = Plot[Sin[x], {x, 0, 2Pi}, Ticks -> {{0, Pi, 2Pi}, {-1, 1}}, ImageSize -> 60];Table[Graphics[{Inset[g, Center, {p, 0}], Circle[]}, Axes -> {False, True}, Ticks -> None], {p, {0, Pi, 2Pi}}]Table[Graphics[{Inset[g, Center, {Pi, p}], Circle[]}, Axes -> {True, False}, Ticks -> None], {p, {-1, 0, 1}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, {p, Center}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {0, Pi, 2Pi}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, {Pi, p}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {p, {-1, 0, 1}}]g = Plot[Sin[x], {x, 0, 2Pi}, Ticks -> None, AxesOrigin -> {0, 1 / 2}, ImageSize -> 60];Graphics[{Inset[g, Center, {Center, Axis}], Circle[]}, Axes -> True, AxesStyle -> Dashed, Ticks -> None]大きさ (7)
大きさが指定されていない,またはAutomaticの場合,挿入されたグラフィックスの画像サイズが使われる:
g = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None, ImageSize -> 50];{Graphics[{Inset[g], Circle[]}, Axes -> True, Ticks -> None], Graphics[{Inset[g, Center, Center, Automatic], Circle[]}, Axes -> True, Ticks -> None]}{Graphics3D[{Inset[g, {0, 0, 0}, Automatic], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], Graphics3D[{Inset[g, {0, 0, 0}, Automatic, Automatic], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True]}{Graphics[{Inset[Style["ABCDEF", 10]], Circle[]}], Graphics[{Inset[Style["ABCDEF", 20]], Circle[]}]}g = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None];Table[Graphics[{Inset[g, Automatic, Automatic, s], Circle[{0, 0}, 2]}, Frame -> True], {s, {1, 2, 3}}]Scaled値を使って幅を指定する:
Table[Graphics[{Inset[g, Automatic, Automatic, s], Circle[{0, 0}, 2]}, Frame -> True], {s, {Scaled[.25], Scaled[.5], Scaled[.75]}}]Offset値を使って絶対サイズをプリンタのポイント数で設定することで幅を指定する:
Table[Graphics[{Inset[g, Automatic, Automatic, s], Circle[{0, 0}, 2]}, Frame -> True], {s, {Offset[20], Offset[40], Offset[60]}}]Insetの幅と高さを指定する:
Graphics[{Inset["", Automatic, Automatic, {1, 2}, Background -> StandardOrange], Circle[{0, 0}, 2]}, Frame -> True]Scaledの幅と高さ:
Graphics[{Inset["", Automatic, Automatic, Scaled[{.3, .8}], Background -> StandardOrange], Circle[{0, 0}, 2]}, Frame -> True]Offsetの幅と高さ:
Graphics[{Inset["", Automatic, Automatic, Offset[{90, 20}], Background -> StandardOrange], Circle[{0, 0}, 2]}, Frame -> True]幅と高さの両方が指定されている場合,グラフィックスは1次元に制限される可能性がある:
g1 = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None];
Graphics[{Inset[g1, Automatic, Automatic, {1.5, .4}, Background -> StandardBrown], Circle[]}]AspectRatioFullと設定すると,グラフィックスは指定のサイズに完全に納まるように引き伸ばされる:
g2 = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None, AspectRatio -> Full];
Graphics[{Inset[g2, Automatic, Automatic, {1.5, .4}, Background -> StandardBrown], Circle[]}]{w, Automatic}はタイプセット式の折り返し幅を指定する:
t = "abcd xyz abcd xyz abcd xyz abcd xyz abcd xyz";Table[Graphics[{Inset[Framed[t], Automatic, Automatic, {s, Automatic}], Circle[{0, 0}, 2]}, Frame -> True], {s, {2, 4}}]g = Plot[Sin[x], {x, 0, 10}, Frame -> True, FrameTicks -> None];Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, s], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {s, {30, 60, 90}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, {s, s}], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True], {s, {30, 60, 90}}]Scaledを使って画像サイズを指定することもできる:
Graphics3D[{Inset[g, {0, 0, 0}, Automatic, Scaled[{.3, .2}]], Line[{{{0, -1, 0}, {0, 1, 0}}, {{-1, 0, 0}, {1, 0, 0}}, {{0, 0, -1}, {0, 0, 1}}}]}, Axes -> True]方向 (3)
g = Plot[Sin[x ^ 2], {x, 0, 4}, Axes -> True, Ticks -> None];Table[Graphics[{Inset[g, Automatic, Automatic, 1.5, d], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, 100, d]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics[{Inset["ABCDEF", Automatic, Automatic, Automatic, d], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, Automatic, Automatic, d]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]g = Plot[Sin[x ^ 2], {x, 0, 4}, Axes -> True, Ticks -> None];Table[Graphics[{Inset[g, Automatic, Automatic, 1.5, {Automatic, d}], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset[g, {0, 0, 0}, Automatic, 100, {Automatic, d}]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics[{Inset["ABCDEF", Automatic, Automatic, Automatic, {Automatic, d}], Circle[]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]Table[Graphics3D[{Inset["ABCDEF", {0, 0, 0}, Automatic, Automatic, {Automatic, d}]}], {d, {{1, 0}, {1, 1}, {0, 1}}}]g = Plot[Sin[x ^ 2], {x, 0, 4}, Axes -> True, Ticks -> None];{Graphics[{Inset[g, Automatic, Automatic, 1.5, {{2, 0}, {1, 2}}], Circle[]}], Graphics3D[{Inset[g, {0, 0, 0}, Automatic, 100, {{2, 0}, {1, 2}}]}]}{Graphics[{Inset[Style["ABCDEF", 20], Automatic, Automatic, Automatic, {{2, 0}, {1, 2}}], Circle[]}], Graphics3D[{Inset[Style["ABCDEF", 20], {0, 0, 0}, Automatic, Automatic, {{2, 0}, {1, 2}}]}]}一般化と拡張 (3)
{Graphics[{Inset[Style["ABCDEF", 20], Automatic, Automatic, Automatic, {{-1, 0}, {0, 1}}], Circle[]}], Graphics3D[{Inset[Style["ABCDEF", 20], {0, 0, 0}, Automatic, Automatic, {{-1, 0}, {0, 1}}]}]}{Graphics[{Inset[Style["ABCDEF", 20], Automatic, Automatic, Automatic, {{1, 0}, {0, -1}}], Circle[]}], Graphics3D[{Inset[Style["ABCDEF", 20], {0, 0, 0}, Automatic, Automatic, {{1, 0}, {0, -1}}]}]}control = DynamicModule[{x = 0}, Button[Dynamic[x], x++;EmitSound[Sound[SoundNote[]]]]];
{Graphics[{Circle[], Inset[control, {0, 0}]}], Graphics3D[{Sphere[{0, -1, 0}, 0.5], Inset[control, {0, 0, 0}]}]}オプション (7)
Alignment (1)
Background (1)
BaseStyle (2)
{Graphics[{Inset[Style["circle", StandardBlue], BaseStyle -> Directive[Large, Italic]], Circle[]}], Graphics3D[{Inset[Style["circle", StandardBlue], BaseStyle -> Directive[Large, Italic]]}]}{Graphics[{Inset["circle", BaseStyle -> "Title"], Circle[]}], Graphics3D[{Inset["circle", BaseStyle -> "Title"]}]}ContentSelectable (1)
FormatType (2)
デフォルトで,式はTraditionalFormで表示される:
Graphics[{Inset[Style[x ^ 2 + y ^ 2 < 1, Medium]], Circle[]}]StandardFormで式を表示する:
Graphics[{Inset[Style[x ^ 2 + y ^ 2 < 1, Medium], FormatType -> StandardForm], Circle[]}]アプリケーション (3)
legendPlot[xl_List, d_, args___] := Plot[xl, d, Epilog -> Inset[Panel[Grid[MapIndexed[{Graphics[{ColorData[97, First@#2], Thick, Line[{{0, 0}, {1, 0}}]}, AspectRatio -> .1, ImageSize -> 20], #1}&, xl]]], Offset[{-2, -2}, Scaled[{1, 1}]], {Right, Top}], args]legendPlot[{Sin[x], Cos[x], Sinc[x]}, {x, 0, 10}]co = {"Austria", "Belgium", "France", "Germany", "Ireland", "Italy", "Luxembourg", "Netherlands", "Portugal", "Spain", "Switzerland", "UnitedKingdom"};Insetで注釈関数を設定する:
a[c_] := Inset[Grid[{{c, SpanFromLeft}, {"Pop.", Row[{Round[CountryData[c, "Population"] / 10 ^ 6], " mil."}]}, {"Flag", Show[CountryData[c, "Flag"], ImageSize -> 30]}}, BaseStyle -> Directive[Small, FontFamily -> "Helvetica"], Background -> White, Frame -> All], Reverse@CountryData[c, "CenterCoordinates"]];Graphics[{EdgeForm[StandardGray], LightBlue, CountryData[#, "Polygon"]& /@ co, Black, a /@ co}, ImageSize -> 500]stockPlot[sl_List, {y_, m_}, args___] := DateListPlot[FinancialData[#, {y, m}]& /@ sl, Joined -> True, PlotMarkers -> Automatic, PlotRange -> {All, {0, All}}, PlotStyle -> ColorData[91, "ColorList"], Epilog -> Inset[Panel[Grid[MapIndexed[{Style[{●, ■, ◆}[[First@#2]], ColorData[91, First@#2]], FinancialData[#1, "Name"]}&, sl]]], Offset[{-2, 2}, Scaled[{1, .3}]], {Right, Bottom}], args]stockPlot[{"F", "TM", "HMC"}, {2007, 3}]特性と関係 (2)
記号位置はImageScaled座標と相対的である:
Table[Framed@Graphics[{Inset["ABCDEF", {s, Center}], Circle[]}, ImagePadding -> {{10, 40}, {0, 0}}], {s, {Left, Center, Right}}]Table[Framed@Graphics[{Inset["ABCDEF", {Center, s}], Circle[]}, ImagePadding -> {{0, 0}, {10, 20}}], {s, {Top, Center, Bottom}}]タイプセット式の場合,TextはInsetに似た機能を提供する:
Graphics[{Text[x ^ 2 + y ^ 2 == 1, {0, 0}], Circle[]}]Graphics3D[{{DarkGray, Text[x ^ 2 + y ^ 2 + z ^ 2 == 1, {0, 0, 0}]}, Sphere[]}]テクニカルノート
関連するガイド
関連するワークフロー
- グラフィックスを別のグラフィックスに挿入する
テキスト
Wolfram Research (2007), Inset, Wolfram言語関数, https://reference.wolfram.com/language/ref/Inset.html (2014年に更新).
CMS
Wolfram Language. 2007. "Inset." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/Inset.html.
APA
Wolfram Language. (2007). Inset. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Inset.html
BibTeX
@misc{reference.wolfram_2026_inset, author="Wolfram Research", title="{Inset}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/Inset.html}", note=[Accessed: 14-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_inset, organization={Wolfram Research}, title={Inset}, year={2014}, url={https://reference.wolfram.com/language/ref/Inset.html}, note=[Accessed: 14-November-2026]}