# Annotations

Audience: Scientists

# 1. Introduction

Annotations add additional text to the page. They are free text that can be attached anywhere to the canvas or attached to data. This is a step usually left to another software as the figure is prepared for publication, such as Photoshop or Power Point, but it's useful to be able to do this within Autoplot for communication with a colleague and to get the display all the closer to be ready for publication. (Annotations are first available in development release 20151031a)

To add an annotation, right-click on the plot image and select "Add Annotation." This will ask for starting text and will optionally allow the annotation to be anchored to a point on the plot. This annotation is now a part of the dom configuration and will be saved into a .vap file. Right-click on the annotation to edit its properties or to delete the annotation.

# 3. Anchor Location

The annotation properties can be edited with the properties dialog. These annotations have a set of controls that is a bit overwhelming, and some are used more often than others.

When anchored to the canvas, the annotation is positioned relative to a row and a column, and by default this is the row and column of the plot which created the annotation. The rowId and columnId properties can be reset, or set to an empty string to mean the entire width or height of the canvas. The annotation can be positioned at any of the corners or the center of this row-column box, and inside or outside of the box. There is an anchorOffset that allows the annotation to be moved, which is "1em,1em" initially. This means 1em towards the box center in horizontal and vertical position. If the annotation were positioned outside of the box, then this would be away from the box.

When the annotation is positioned relative to data, the xrange and yrange define the box position. The annotation is then relative to the box specified by these two properties.

# 4. Font and Colors

By default the annotation inherits its font and colors from the canvas. The background will be the same as the canvas background and foreground the same as the canvas foreground. When overrideColors is true, the foreground, background, and textColor are used instead.

Although the font cannot be changed, the font size used is specified relative to the canvas font. So the default "1em" means that the font size should be the same as other labels on the canvas. "2em" would be twice as big and "1.0em+2pt" would be 2 points bigger.

# 5. Adding Annotations in Scripts

Annotations can be added in scripts using the addAnnotation method of the ApplicationController:

from org.das2.graph import BorderType
anno.anchorOffset= "2em,2em"
anno.borderType= BorderType.ROUNDED_RECTANGLE


Autoplot v2017a_8 will have an "annotation" command simplifying use in Jython scripts:

a= annotation(0,text="Annotation",borderType='Rounded_Rectangle')


The "0" is like the plot command's index, where it is just an index so the page isn't filled with annotations as the script is run repeatedly.

# 6. Macros in Annotations

The following macros are available for use in annotations: