8.8.2 Labeling Plots using the Annotation Tool


For global labeling of 2D plots (also labeling of individual data points), see Labeling Plots using Label tab or Mini Toolbars.

For precise picking and labeling specific points on 2D and Contour plots, you can use the customizable Annotation tool.

OH creating annotation1.png

Another way to selectively label data points is by using Plot Details controls for Show at Specified Points Only.

Contents

Creating a standard annotation

  1. Click on the Annotation button Button Data Annotation.png on the Tools toolbar. (2025b)You can use the Labtalk command dotool 100 to start the annotation tool in graph.
  2. In the opened dialog Annotataion which shows up with the annotation cursor, you can choose the label form, font, font size and font color for the labels you are going to add.
  3. Hover on the graph window and you can use the TAB key to toggle between annotation options (options visible on the Annotation cursor or on the Status bar at the lower-left side of the workspace).
Status Bar Annotation Form.png


2D XY data plots:

Annotation Form Cursor
($(x), $(y)) or other custom form Creating Annotation Custom.png
(X coordinate value, Y coordinate value) Creating Annotation XY.png
(X coordinate value, Y coordinate value) [index number] Creating Annotation XYi.png
X coordinate value Creating Annotation X.png
Y coordinate value Creating Annotation Y.png
Index number (row number) Creating Annotation i.png


Contour plots:

Annotation Form Cursor
($(x), $(y), $(z)) or other Custom Form Creating Annotation Custom.png
(X coordinate value, Y coordinate value, Z coordinate value) Creating Annotation XYZ.png
(X coordinate value, Y coordinate value, Z coordinate value) [Row index number] Creating Annotation XYZi.png
(X coordinate value, Y coordinate value, Z coordinate value) [Row index number] [Column index number] Creating Annotation XYZij.png
X coordinate value Creating Annotation X.png
Y coordinate value Creating Annotation Y.png
Z coordinate value Creating Annotation Z.png
Index number (row number) Creating Annotation i.png
(Index number (row number),Index number (column number)) Creating Annotation ij.png


When you select a data point of a data plot, you can click on the data plot, and then press ← and → on keyboard to cycle among data points.

Editing an annotation

Pre-define the style and label form of annotations

Once you clicked the Annotation button Button Data Annotation.png, a mini dialog Annotation will show up to let you choose a label form and set the styles of the labels.

Creating Annotation minidialog.png

customize an existing annotation

To customize an existing annotation, you can use the Mini toolbar or Properties… dialog:

Using Mini Toolbar

Creating Annotation minitoolbar.png

Using Properties… dialog

Right-click on the label and select Properties…. This opens the Annotation dialog box:

Using Other Controls

2017 Hightlights Annotation Drag.png

Custom annotations

In addition to the standard annotations and predefined custom annotation in the list, you can add a single custom annotation string that can incorporate arbitrary text and LabTalk variables in the Label box and then add the annotation. Or you can add an standard annotation firstly, and then right-click it to open the Annotation dialog box to customize the label content in Text tab.

Custom Annotation Tooltip.png

Example 1: Show Formula-Adjusted value as Annotation

In this example, we will use the Axis dialog box Formula box to create a custom tick label, then customize the Annotation tool to display the "formula" value instead of the actual value of the Y axis:

  1. Start with a fresh worksheet, select both columns then right-click and Fill Columns with Random Numbers.
  2. Click the Scatter button Button Scatter.png on the 2D Graphs toolbar.
  3. Double-click on the Y axis labels and in the Axis dialog box Display tab, enter x*pi into the Formula box and click OK. Note that the Y axis tick labels are now adjusted to display your according to the entered formula.
  4. Click on the Annotation tool Button Data Annotation.png, select any point and double-click on the point to add an annotation label.
  5. Select the Pointer tool Button Pointer.png, right-click on the label and choose Properties.
  6. In the text box, enter the string $(x), $(y,y) and click the Set as Default button before you OK out of the dialog box. Note that the label now properly displays the formula-adjusted value of the Y axis and if you want to show the label in the Y axis major tick label format, you can enter $(x), $(y,yt).
  7. Reselect the Pointer tool then press the ALT key and drag the custom label to another data point in the graph. Note that the annotation label updates with the new point coordinates.

Example 2: Show Image as Annotation

Besides annotating the points with cell values or strings, you are also allowed to show embedded images as annotation labels.
Annotation EmbeddedCellImage.png

Labels created with the Annotation tool are text objects that use substitution to display a numeric value, a text string or an embedded image; As such, they support customizations beyond those discussed here. For more information, see Notations and syntax used in labeling plotted data and Text Label Substitution, both in the LabTalk Programming Guide.