8.7.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.

Creating a standard annotation

  1. Click on the Annotation button Button Data Annotation.png on the Tools toolbar.
  2. Hover on the graph window and 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 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 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

To customize an existing annotation, right-click on the label and select Properties…. This opens the Annotation dialog box:

  • As any other text objects, you can edit and format the text of the annotation in Text tab and its frame and background in Frame tab.
  • The leader line is a line object attaches an annotation object to its data point. If you want change the style of a leader line, go to Leader Line tab.
  • Once an annotation object is created, you can drag it anywhere in the graph page, and the leader line connecting the label to the data point will follow.
  • You can move an annotation object to another data point by pressing the ALT key and dragging the object to a new data point. The label will update automatically.
2017 Hightlights Annotation Drag.png

Custom annotations

In addition to the standard annotations, you can add a single custom annotation string that can incorporate arbitrary text and LabTalk variables. When you define a custom string, it becomes one of your TAB key labeling options, identifiable by the tag "Custom".

Custom Annotation Tooltip.png


To create a custom label:

  1. Select the Annotation tool Button Data Annotation.png and label a data point on the graph.
  2. Switch to your Pointer tool Button Pointer.png, then right-click on the annotation object and choose Properties.
  3. In the Annotation dialog box, Text tab, add your custom annotation string in the edit box. Note that while you are in the edit box, you can click the flyout button to the right of the box and insert LabTalk variables into your string.
  4. To save the custom string and add it to your labeling options, click the Set as Default button before you OK out of the dialog box.


Example:

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.

Labels created with the Annotation tool are text objects that use substitution to display a numeric value or a text string; 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.