AnnotationDelete[obj]
deletes all annotations of the object obj.
AnnotationDelete[{obj,itemspec}]
deletes all annotations of the items of obj specified by itemspec.
AnnotationDelete[spec,key]
deletes the annotation key specified by spec.
AnnotationDelete
AnnotationDelete[obj]
deletes all annotations of the object obj.
AnnotationDelete[{obj,itemspec}]
deletes all annotations of the items of obj specified by itemspec.
AnnotationDelete[spec,key]
deletes the annotation key specified by spec.
Details
- Typically used to delete annotations for objects and specific items in an object.
- AnnotationDelete[spec,key] returns the object specified in spec with the annotation key deleted.
- For standard annotations, AnnotationDelete effectively resets the value to the annotation default value.
- Possible objects with items that can be annotated:
-
Audio time points and time intervals BoundaryMeshRegion mesh cells CSGRegion geometric regions Graph vertices and edges MeshRegion mesh cells - Item specification itemspec for each type of object is given in its reference page.
Examples
open all close allBasic Examples (3)
Remove a vertex or edge annotation:
g = CompleteGraph[4, VertexLabels -> {1 -> "here"}, EdgeStyle -> {12 -> Red}]{AnnotationDelete[{g, 1}, VertexLabels], AnnotationDelete[{g, 12}, EdgeStyle]}Remove a style or label annotation:
mr = MengerMesh[1, MeshCellStyle -> {{1, All} -> Red}, MeshCellLabel -> {0 -> "Index"}]{AnnotationDelete[{mr, {1, All}}, MeshCellStyle], AnnotationDelete[{mr, 0}, MeshCellLabel]}Annotate an Audio object:
a = Import["ExampleData/rule30.wav"];res = AudioAnnotate[a, {"tag1" -> {.5 -> "v11", {1, 1.5} -> "v12"}, "tag2" -> {.1 -> "v21", {.7, 1.5} -> "v22"}}];Remove the annotation with a specific tag:
AnnotationDelete[res, "tag1"]//AudioAnnotationLookupScope (11)
Graph & Networks (7)
Graph annotations (5)
Remove one annotation from vertices:
g = CompleteGraph[4, VertexStyle -> {1 -> Red}, VertexSize -> {1 -> Small}, EdgeStyle -> {12 -> Brown}, EdgeLabels -> {12 -> "hello"}]AnnotationDelete[{g, 1}, VertexStyle]AnnotationDelete[{g, 12}, EdgeLabels]Remove all annotations from vertices:
AnnotationDelete[{g, 1}]AnnotationDelete[{g, 12}]Remove several annotations from vertices:
CompleteGraph[4, VertexStyle -> {1 -> Red}, VertexSize -> {1 -> Small}, VertexLabels -> {1 -> "vertex"}];AnnotationDelete[{[image], 1}, {VertexLabels, VertexStyle}]WheelGraph[4, DirectedEdges -> True, EdgeStyle -> {_ -> Arrowheads[0.08], 12 -> Directive[Brown, Arrowheads[0.08]]}, EdgeLabels -> {12 -> "edge"}];AnnotationDelete[{[image], 12}, {EdgeStyle, EdgeLabels}]AnnotationDelete works with undirected graphs:
CycleGraph[3, EdgeStyle -> {12 -> Brown}, EdgeLabels -> {12 -> "edge"}];AnnotationDelete[{[image], 12}, EdgeStyle]CycleGraph[3, DirectedEdges -> True, EdgeStyle -> {12 -> Directive[Arrowheads[Small], Brown], Arrowheads[Small]}, EdgeLabels -> {12 -> "edge"}];AnnotationDelete[{[image], 12}, EdgeStyle]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]]];AnnotationDelete[{[image], 12}, EdgeLabels]Vertex annotations (1)
Set several annotations for a graph:
g = CompleteGraph[4, VertexSize -> Small]AnnotationValue[{g, 4}, VertexStyle] = Red;
AnnotationValue[{g, 1}, VertexLabels] = "hello";
AnnotationValue[{g, 1}, VertexShape] = [image];
AnnotationValue[{g, 1}, VertexSize] = Large;
AnnotationValue[{g, 2}, VertexShapeFunction] = "Square";AnnotationValue[{g, 1}, VertexWeight] = 100;AnnotationValue[{g, 2}, "Material"] = "Wood";gRemove vertex annotations including VertexStyle:
AnnotationDelete[{g, 4}, VertexStyle]AnnotationDelete[{g, 1}, VertexLabels]AnnotationDelete[{g, 1}, VertexSize]AnnotationDelete[{g, 1}, VertexShape]AnnotationDelete[{g, 2}, VertexShapeFunction]AnnotationDelete[{g, 1}, VertexCoordinates]MemberQ[PropertyList[{g, 2}], "Material"]AnnotationDelete[{g, 2}, "Material"];MemberQ[PropertyList[{%, 2}], "Material"]Edge annotations (1)
Set several annotations for a graph:
g = CompleteGraph[4]AnnotationValue[{g, 12}, EdgeStyle] = Brown;
AnnotationValue[{g, 12}, EdgeLabels] = "hello";
AnnotationValue[{g, 34}, EdgeShapeFunction] = "HalfFilledDoubleArrow";
AnnotationValue[{g, 12}, EdgeWeight] = 42;
AnnotationValue[{g, 24}, "Resistance"] = 50.;gRemove edge annotations including EdgeStyle:
AnnotationDelete[{g, 12}, EdgeStyle]AnnotationDelete[{g, 12}, EdgeLabels]AnnotationDelete[{g, 34}, EdgeShapeFunction]MemberQ[AnnotationKeys[{g, 24}], "Resistance"]AnnotationDelete[{g, 24}, "Resistance"];MemberQ[AnnotationKeys[{%, 24}], "Resistance"]Regions (4)
Remove one annotation from a child region:
CSGRegion["Union", {Style[Ball[], Red], Style[Cuboid[], Blue]}]AnnotationDelete[{%, {1}}, "CSGRegionStyle"]Remove all annotations from a child region:
CSGRegion["Union", {Style[Annotation[Ball[], "Material" -> "Metal"], Red], Cuboid[]}]AnnotationDelete[{%, {1}}]Remove an annotation from all child regions:
CSGRegion["Union", {Style[Annotation[Ball[], "Material" -> "Wood"], Red], Style[Cuboid[], Blue]}]AnnotationDelete[%, "CSGRegionStyle"]AnnotationKeys[{%, {1}}]Remove all annotations from a CSGRegion object:
CSGRegion["Union", {Style[Annotation[Ball[], "Material" -> "Wood"], Red], Style[Cuboid[], Blue]}]AnnotationDelete[%]AnnotationKeys[{%, {1}}]Applications (2)
Linda wants to be anonymous in the presentation of the family gathering. Hide her vertex label:
ExampleData[{"NetworkGraph", "FamilyGathering"}]AnnotationDelete[{%, "Linda"}, VertexLabels]Use Fold to apply AnnotationDelete repeatedly:
g = CycleGraph[8, VertexStyle -> Table[i -> RandomChoice[{Red, Green, Blue}], {i, 8}], VertexSize -> Large]Fold[AnnotationDelete[{#1, #2}, VertexStyle]&, g, Range[1, 7]]FoldList[AnnotationDelete[{#1, #2}, VertexStyle]&, g, Range[1, 7]]Properties & Relations (6)
Use Annotation as a wrapper to specify annotations in functions such as Graph:
Graph[{Annotation[1, {VertexSize -> Medium, VertexStyle -> Red}], 2, 3}, {12, 23, 31}]Use AnnotationValue to extract values:
g = CompleteGraph[4, VertexStyle -> {1 -> Red}, VertexSize -> Small]AnnotationValue[{g, 1}, VertexStyle]For undefined annotations, the value $Failed is returned:
AnnotationValue[{g, 1}, "foo"]MemberQ[AnnotationKeys[{g, 1}], "foo"]Use AnnotationValue to set annotations in a graph:
g = CompleteGraph[4]AnnotationValue[{g, 1}, VertexSize] = Small;The original graph has changed:
gUse AnnotationValue to unset annotations in a graph:
g = CompleteGraph[4, VertexSize -> {1 -> Small}]AnnotationValue[{g, 1}, VertexSize]=.;The original graph has changed:
gUse AnnotationKeys to test for the presence of a annotation:
g = CompleteGraph[4, VertexLabels -> {1 -> one, 4 -> four}]MemberQ[AnnotationKeys[{g, 1}], VertexLabels]Generate a list of vertex label rules:
Cases[VertexList[g], v_ /; MemberQ[AnnotationKeys[{g, v}], VertexLabels] :> v -> AnnotationValue[{g, v}, VertexLabels]]Use Annotate to set a annotation without changing the original:
g = CompleteGraph[4]Annotate[{g, 1}, VertexSize -> Medium]The original graph is unchanged:
gPossible Issues (1)
AnnotationValue is typically faster than AnnotationDelete:
g = Graph[Annotation[#, VertexWeight -> 10.]& /@ Range[1000], {}];Timing@Do[AnnotationValue[{g, v}, VertexWeight]=., {v, VertexList[g]}]g = Graph[Annotation[#, VertexWeight -> 10.]& /@ Range[1000], {}];Timing@Do[g = AnnotationDelete[{g, v}, VertexWeight], {v, VertexList[g]}]Related Guides
Text
Wolfram Research (2019), AnnotationDelete, Wolfram Language function, https://reference.wolfram.com/language/ref/AnnotationDelete.html (updated 2025).
CMS
Wolfram Language. 2019. "AnnotationDelete." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/AnnotationDelete.html.
APA
Wolfram Language. (2019). AnnotationDelete. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AnnotationDelete.html
BibTeX
@misc{reference.wolfram_2026_annotationdelete, author="Wolfram Research", title="{AnnotationDelete}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/AnnotationDelete.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_annotationdelete, organization={Wolfram Research}, title={AnnotationDelete}, year={2025}, url={https://reference.wolfram.com/language/ref/AnnotationDelete.html}, note=[Accessed: 13-June-2026]}