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:
  • Audiotime points and time intervals
    BoundaryMeshRegionmesh cells
    Graphvertices and edges
    MeshRegionmesh cells
  • Item specification itemspec for each type of object is given in its reference page.

Examples

open allclose all

Basic Examples  (3)

Remove a vertex or edge annotation:

Remove a style or label annotation:

Annotate an Audio object:

Remove the annotation with a specific tag:

Scope  (7)

Graph & Networks  (7)

Graph annotations  (5)

Remove one annotation from vertices:

And from edges:

Remove all annotations from vertices:

And from edges:

Remove several annotations from vertices:

And from edges:

AnnotationDelete works with undirected graphs:

Directed graphs:

Weighted graphs:

Vertex annotations  (1)

Set several annotations for a graph:

Remove vertex annotations including VertexStyle:

VertexLabels:

VertexSize:

VertexShape:

VertexShapeFunction:

VertexCoordinates:

A custom annotation:

Edge annotations  (1)

Set several annotations for a graph:

Remove edge annotations including EdgeStyle:

EdgeLabels:

EdgeShapeFunction:

A custom annotation:

Applications  (2)

Linda wants to be anonymous in the presentation of the family gathering. Hide her vertex label:

Use Fold to apply AnnotationDelete repeatedly:

See all the partial results:

Properties & Relations  (6)

Use Annotation as a wrapper to specify annotations in functions such as Graph:

Use AnnotationValue to extract values:

For undefined annotations, the value $Failed is returned:

Use AnnotationValue to set annotations in a graph:

The original graph has changed:

Use AnnotationValue to unset annotations in a graph:

The original graph has changed:

Use AnnotationKeys to test for the presence of a annotation:

Generate a list of vertex label rules:

Use Annotate to set a annotation without changing the original:

The original graph is unchanged:

Possible Issues  (1)

AnnotationValue is typically faster than AnnotationDelete:

Wolfram Research (2019), AnnotationDelete, Wolfram Language function, https://reference.wolfram.com/language/ref/AnnotationDelete.html (updated 2020).

Text

Wolfram Research (2019), AnnotationDelete, Wolfram Language function, https://reference.wolfram.com/language/ref/AnnotationDelete.html (updated 2020).

CMS

Wolfram Language. 2019. "AnnotationDelete." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. 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_2024_annotationdelete, author="Wolfram Research", title="{AnnotationDelete}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/AnnotationDelete.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_annotationdelete, organization={Wolfram Research}, title={AnnotationDelete}, year={2020}, url={https://reference.wolfram.com/language/ref/AnnotationDelete.html}, note=[Accessed: 21-December-2024 ]}