gives any mouse annotation associated with the expression at the current mouse position.
MouseAnnotation
gives any mouse annotation associated with the expression at the current mouse position.
Details
- MouseAnnotation[] returns Null if there is no mouse annotation associated with the expression at the current mouse position.
- MouseAnnotation[def] returns def if there is no current annotation.
- MouseAnnotation[] yields the mouse annotation associated with the expression that would be selected if the mouse were clicked.
- The annotation is the expression note in Annotation[expr,note,"Mouse"].
- Dynamic[MouseAnnotation[]] gives the continually updated current mouse annotation.
Examples
open all close allBasic Examples (2)
If the mouse is over the graphics, MouseAnnotation will return the associated annotation:
Annotation[Graphics[Disk[]], "An annotation", "Mouse"]When the mouse is over the graphics, the annotation is displayed:
Dynamic[MouseAnnotation[]]Plot[{Annotation[Sin[x], "Sine", "Mouse"], Annotation[Cos[x], "Cosine", "Mouse"]}, {x, 0, 2π}, PlotStyle -> Thick]Dynamic[MouseAnnotation[]]Scope (1)
Applications (1)
Use MouseAnnotation to update the state associated with each graphic:
DynamicModule[{x = {0, 0, 0}}, EventHandler[{Annotation[Graphics[{Red, Disk[]}, PlotLabel -> Dynamic[x[[1]]]], 1, "Mouse"], Annotation[Graphics[{Green, Disk[]}, PlotLabel -> Dynamic[x[[2]]]], 2, "Mouse"], Annotation[Graphics[{Blue, Disk[]}, PlotLabel -> Dynamic[x[[3]]]], 3, "Mouse"]}, {"MouseClicked" :> (x[[MouseAnnotation[]]] = x[[MouseAnnotation[]]] + 1)}]]Properties & Relations (3)
MouseAnnotation reveals annotations stored in other expressions:
Annotation["xxx", "Label", "Mouse"]Dynamic[MouseAnnotation[]]Tooltip presents the annotated information in a popup box:
Tooltip[x + y, label]Mouseover presents the annotated information by changing the displayed form:
Mouseover[x + y, label]See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2007), MouseAnnotation, Wolfram Language function, https://reference.wolfram.com/language/ref/MouseAnnotation.html.
CMS
Wolfram Language. 2007. "MouseAnnotation." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MouseAnnotation.html.
APA
Wolfram Language. (2007). MouseAnnotation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MouseAnnotation.html
BibTeX
@misc{reference.wolfram_2026_mouseannotation, author="Wolfram Research", title="{MouseAnnotation}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/MouseAnnotation.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mouseannotation, organization={Wolfram Research}, title={MouseAnnotation}, year={2007}, url={https://reference.wolfram.com/language/ref/MouseAnnotation.html}, note=[Accessed: 12-June-2026]}