Annotation

Annotation[expr,data]

represents an expression expr, with annotation data.

Annotation[expr,data,"type"]

specifies the type of annotation being given.

Annotation[items,keyvalue]

associates keyvalue pairs with items in objects such as Graph, MeshRegion etc.

Details

  • Annotation[expr,] displays in a notebook as expr.
  • Annotation acts as an inert wrapper for storing annotations in expressions.
  • Annotation can be used with graphics or any other expression.
  • With particular "type" specifications, annotations are picked up by various built-in functions:
  • "Hyperlink"hyperlink for exported image maps etc.
    "Mouse"annotation for MouseAnnotation
    "Region"regions for Rasterize, Export, etc.
    "Tooltip"tooltip specification for Export etc.
  • With keyvalue specifications, annotations are associated to items in various objects:
  • Audiotime points and time intervals
    BoundaryMeshRegionmesh cells
    CSGRegiongeometric regions
    Graphvertices and edges
    MeshRegionmesh cells

Examples

open allclose all

Basic Examples  (3)

Dynamically get the annotation when the mouse enters the disk:

Annotate an edge in a graph:

Retrieve the annotation:

Annotate curves in a plot and display a label when the mouse pointer is over a curve:

Scope  (8)

Basic Uses  (5)

Store annotations in an expression:

Retrieve expressions with specific annotations:

Annotate an edge in a graph:

Annotate curves in a plot:

Add a hyperlink to any part of the expression when converting to an HTML file:

Use Rasterize to find the position of the annotated object within the image:

Specifications  (3)

Annotate an expression:

Specify the type of annotation:

Associate key and value pairs to objects:

Applications  (6)

Graphs  (2)

Build a graph with VertexSize and VertexStyle annotations on vertices:

Use Annotation to specify the weight for individual edges:

The list of edge weights in the order given in the graph:

Export  (2)

Add a hyperlink to any part of the expression when converting to an HTML file:

Add a tooltip to any part of the expression when converting to an HTML file:

Rasterize  (2)

Rasterize returns a graphical depiction of the object and is used within Export:

Use Rasterize to find the position of the annotated object within the image:

Rasterize will take any expression as input:

Automatically find the location of multiple expressions:

Properties & Relations  (1)

Tooltip and Hyperlink annotations can be replaced by their respective functions:

An equivalent expression:

Wolfram Research (2007), Annotation, Wolfram Language function, https://reference.wolfram.com/language/ref/Annotation.html (updated 2025).

Text

Wolfram Research (2007), Annotation, Wolfram Language function, https://reference.wolfram.com/language/ref/Annotation.html (updated 2025).

CMS

Wolfram Language. 2007. "Annotation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/Annotation.html.

APA

Wolfram Language. (2007). Annotation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Annotation.html

BibTeX

@misc{reference.wolfram_2024_annotation, author="Wolfram Research", title="{Annotation}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/Annotation.html}", note=[Accessed: 20-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_annotation, organization={Wolfram Research}, title={Annotation}, year={2025}, url={https://reference.wolfram.com/language/ref/Annotation.html}, note=[Accessed: 20-January-2025 ]}