Annotate
詳細
- オブジェクトまたはオブジェクト内の項目についての key->value ペアの保存のために使われることが多い.
- Annotateは指定されたオブジェクトに新たなまたは変更された注釈を付けて返す.
- 次は,注釈を付けられる項目を含む可能性があるオブジェクトである.
-
Audio 時点と時間間隔 BoundaryMeshRegion メッシュセル CSGRegion 幾何学領域 Graph 頂点と辺 MeshRegion メッシュセル - 各タイプのオブジェクトについての項目指定 itemspec は該当する関数ページを参照のこと.
例題
すべて開く すべて閉じる例 (3)
g = CompleteGraph[4]Annotate[{g, 1}, VertexLabels -> "one"]Annotate[{g, 12}, EdgeStyle -> Red]Annotate[{MengerMesh[2], {1, "Boundary"}}, MeshCellStyle -> Red]CSGRegion内の領域をハイライトする:
Annotate[{CSGRegion[{Ball[], Cuboid[]}], {2}}, "CSGRegionStyle" -> Red]スコープ (17)
グラフとネットワーク (11)
グラフの注釈 (7)
CompleteGraph[4];Annotate[{[image], 1}, VertexSize -> Small]Annotate[{[image], 12}, EdgeLabels -> "hello"]CompleteGraph[4, VertexSize -> Medium];Annotate[{[image], 1}, {VertexStyle -> Magenta, VertexLabels -> "hello"}]Annotate[{[image], 12}, {EdgeStyle -> Magenta, EdgeLabels -> "hello"}]Annotateは無向グラフに使うことができる:
CycleGraph[3];Annotate[{[image], 12}, {EdgeStyle -> Brown}]CycleGraph[3, DirectedEdges -> True, EdgeStyle -> Arrowheads[Small]];Annotate[{[image], 12}, {EdgeLabels -> "hello"}]Graph[{1, 2, 3}, {12, 23, 23, 23, 31}];Annotate[{[image], 12}, {EdgeStyle -> Brown}]Graph[{1, 2, 3}, {12, 23, 31}, EdgeStyle -> Arrowheads[0.08]];Annotate[{[image], 12}, {EdgeStyle -> Brown}]With[{g = CycleGraph[3], w = 0.3Range[3],
pl = {Above, Right, Right} /. {Right -> {1 / 2, {-0.4, 1 / 2}}, Above -> {1 / 2, {1 / 2, 0}}}},
Graph[VertexList[g], EdgeList[g], EdgeWeight -> w, VertexShapeFunction -> "Name", EdgeLabels -> Thread[EdgeList[g] -> MapThread[Placed, {w, pl}]], VertexCoordinates -> GraphEmbedding[g]]];Annotate[{[image], 12}, {EdgeStyle -> Dashed}]頂点の注釈 (2)
標準的な頂点の注釈にはVertexStyleが含まれる:
g = CompleteGraph[4, VertexSize -> Medium]Annotate[{g, 4}, VertexStyle -> Red]Annotate[{g, 1}, VertexLabels -> "one"]Annotate[{g, 1}, VertexSize -> Tiny]Annotate[{g, 1}, VertexShape -> [image]]Annotate[{g, 2}, VertexShapeFunction -> "Square"]不可視の注釈にはVertexWeightが含まれる:
Annotate[{g, 1}, VertexWeight -> 100]AnnotationValue[{%, 1}, VertexWeight]CompleteGraph[4];Annotate[{[image], 2}, "Material" -> "Wood"]AnnotationValue[{%, 2}, "Material"]辺の注釈 (2)
標準的な辺の注釈にはEdgeStyleが含まれる:
g = CompleteGraph[4]Annotate[{g, 12}, EdgeStyle -> Brown]Annotate[{g, 12}, EdgeLabels -> 12]Annotate[{g, 34}, EdgeShapeFunction -> "HalfFilledDoubleArrow"]不可視の注釈にはEdgeWeightが含まれる:
Annotate[{g, 12}, EdgeWeight -> 42]AnnotationValue[{%, 12}, EdgeWeight]CompleteGraph[4];Annotate[{[image], 24}, "Resistance" -> 50.]AnnotationValue[{%, 24}, "Resistance"]領域 (6)
BoundaryMeshRegion (2)
点に注釈を付ける(Annotate):
bmr = BoundaryMesh[Cube[]];Annotate[{bmr, {0, 7}}, MeshCellStyle -> {PointSize[Large], Red}]Annotate[{bmr, {1, 9}}, MeshCellStyle -> {Thick, Red}]Annotate[{bmr, {2, 6}}, MeshCellStyle -> {Red}]特定の次元のすべてのメッシュセルに注釈を付ける(Annotate):
bmr = BoundaryMesh[Cube[]];Table[Annotate[{bmr, {d}}, MeshCellStyle -> Red], {d, {0, 1, 2}}]MeshRegion (2)
点に注釈を付ける(Annotate):
mr = MengerMesh[1];Annotate[{mr, {0, 7}}, MeshCellStyle -> {PointSize[Large], Red}]Annotate[{mr, {1, 2}}, MeshCellStyle -> {Thick, Red}]Annotate[{mr, {2, 1}}, MeshCellStyle -> {Red}]特定の次元のすべてのメッシュセルに注釈を付ける(Annotate):
mr = MengerMesh[2];Table[Annotate[{mr, {d}}, MeshCellStyle -> Red], {d, {0, 1, 2}}]CSGRegion (2)
アプリケーション (3)
g = CycleGraph[8, VertexSize -> Large]Fold[Annotate[{#1, #2}, VertexStyle -> ColorData[45, #2]]&, g, Range[1, 5]]FoldList[Annotate[{#1, #2}, VertexStyle -> ColorData[45, #2]]&, g, Range[1, 6]]g = CompleteGraph[4]Annotate[{g, 1}, VertexSize -> Medium]Annotate[{g, 2}, VertexSize -> Medium]g = CompleteKaryTree[4, 3, DirectedEdges -> True]ListAnimate[Reap[BreadthFirstScan[g, {"FrontierEdge" -> (Sow[Annotate[{g, #}, EdgeStyle -> Red]]& )}]][[2, 1]], DefaultDuration -> Length[EdgeList[g]] / 2, SaveDefinitions -> True]特性と関係 (6)
Annotationをラッパーとして使ってGraphのような関数における注釈を指定する:
Graph[{Annotation[1, {VertexSize -> Medium, VertexStyle -> Red}], 2, 3}, {12, 23, 31}]AnnotationValueを使って値を抽出する:
g = CompleteGraph[4, VertexStyle -> {1 -> Red}, VertexSize -> Small]AnnotationValue[{g, 1}, VertexStyle]未定義の注釈については,値$Failedが返される:
AnnotationValue[{g, 1}, "foo"]MemberQ[AnnotationKeys[{g, 1}], "foo"]AnnotationValueを使ってグラフ内に注釈を設定する:
g = CompleteGraph[4]AnnotationValue[{g, 1}, VertexSize] = Small;gAnnotationValueを使ってグラフ内の注釈の設定を解除する:
g = CompleteGraph[4, VertexSize -> {1 -> Small}]AnnotationValue[{g, 1}, VertexSize]=.;gAnnotationKeysを使って注釈があるかどうか調べる:
g = CompleteGraph[4, VertexLabels -> {1 -> one, 4 -> four}]MemberQ[AnnotationKeys[{g, 1}], VertexLabels]Cases[VertexList[g], v_ /; MemberQ[AnnotationKeys[{g, v}], VertexLabels] :> v -> AnnotationValue[{g, v}, VertexLabels]]AnnotationDeleteを使ってもとのグラフを変えずに注釈を削除する:
g = CompleteGraph[4, VertexStyle -> {1 -> Red}, VertexSize -> Small]AnnotationDelete[{g, 1}, VertexStyle]g考えられる問題 (1)
AnnotationValueは,一般的に,Annotateよりも速い:
g = CycleGraph[1000];Timing@Do[AnnotationValue[{g, v}, VertexWeight] = RandomReal[], {v, VertexList[g]}]g = CycleGraph[1000];Timing@Do[g = Annotate[{g, v}, VertexWeight -> RandomReal[]], {v, VertexList[g]}]関連するガイド
-
▪
- グラフのアノテーション ▪
- アノテーション
テキスト
Wolfram Research (2020), Annotate, Wolfram言語関数, https://reference.wolfram.com/language/ref/Annotate.html (2025年に更新).
CMS
Wolfram Language. 2020. "Annotate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/Annotate.html.
APA
Wolfram Language. (2020). Annotate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Annotate.html
BibTeX
@misc{reference.wolfram_2026_annotate, author="Wolfram Research", title="{Annotate}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/Annotate.html}", note=[Accessed: 20-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_annotate, organization={Wolfram Research}, title={Annotate}, year={2025}, url={https://reference.wolfram.com/language/ref/Annotate.html}, note=[Accessed: 20-June-2026]}