Location and Position of Curve Labels

Overview

On plots that generate a curve line (a series plot or a density plot, for example), you can specify a label for the curve line. You can also determine the label’s location in the graph. For example, the SERIESPLOT statement provides the following options for managing a curve label:
CURVELABEL
Specifies a label for the curve line.
CURVELABELLOCATION
Specifies the location of the curve line label relative to the plot area.
CURVELABELPOSITION
Specifies the position of the label relative to the curve line.

Curve Label Location Relative to the Plot Area

By default, the label for a curve line is displayed inside of the plot area. The following figure shows the default location of the label for a series plot labeled “Curve Label”:
Graph with Curve Label Displayed Inside of the Plot Area
Depending on the shape of the curve line, its distribution of values, and the other plot elements that must be displayed within the plot area, GTL might have to add an offset (see Adjusting Axis Offsets) to one of the plot’s axis lines to provide enough room for the curve label. To prevent the offset of the axis line, you can move the curve label outside of the plot area by specifying CURVELABELLOCATION=OUTSIDE on the plot statement:
Graph with Curve Label Displayed Outside of the Plot Area
Regardless of whether the curve label is displayed inside or outside of the plot area, you can use the CURVELABELPOSITION= option to adjust the label’s position relative to the curve line.

Curve Label Position Relative to the Curve Line

Given a curve label’s location inside or outside of the plot area, a plot statement’s CURVELABELPOSITION= option can adjust the label’s position relative to the curve line. For example, the following positions are available for a series plot (for some plots, START and END are not available):
AUTO
Only used when CURVELABELLOCATION=OUTSIDE. The curve label is positioned automatically near the end series line along unused axes whenever possible (typically Y2 or X2) to avoid collision with tick values.
MAX
Forces the curve label to appear near maximum series values (typically, to the right).
MIN
Forces the curve label to appear near minimum series values (typically, to the left).
START
Only used when CURVELABELLOCATION=INSIDE. Forces the curve label to appear near the beginning of the curve. Particularly useful when the curve line has a spiral shape.
END
Only used when CURVELABELLOCATION=INSIDE. Forces the curve label to appear near the end of the curve. Particularly useful when the curve line has a spiral shape.
When CURVELABELLOCATION=INSIDE, you can choose whether to position the curve label near the START or END of the curve, or near the minimum data values (MIN) or maximum data values (MAX). START and END use a different algorithm than MIN and MAX. They are particularly useful for spiral-shaped curves whose end points do not correlate with the minimum and maximum data values. In those cases, START or END provide “better” label locations than MIN and MAX.
When CURVELABELLOCATION=OUTSIDE and CURVELABELPOSITION=AUTO, a “good” position is automatically chosen to avoid collision with the axis information.
The following figure shows the different combinations of label locations and positions:
Illustration Showing Different Combinations of Label Locations and Positions
  • The minimum or maximum axis tick marks can be adjusted (see Adjusting Axis Offsets) so that the label can be placed inside the plot area. Increasing label length decreases the area available for displaying plots.
  • When CURVLABELLOCATION=OUTSIDE, you can set the CURVELABELPOSITION to MIN or MAX, but the label might collide with the axis ticks and tick values, unless you are aware of where the axes are positioned.