NCL Home > Documentation > HLUs > Classes

Title class

The Title object draws main, X, and Y axis titles for a parent plot or overlay object.

Synopsis

Header file:		ncarg/hlu/Title.h
Class name:		titleClass
Class pointer:		NhltitleClass
Fortran class function:	NHLFTITLECLASS
Superclass:		View
Composite classes:	<None>

Resources

Local resources

+---------------------------------------------------------------+
|			Title Resource Set			|
|---------------------------------------------------------------|
| NAME				TYPE			ACCESS	|
|	CLASS				DEFAULT			|
|===============================================================|
| tiDeltaF                      NhlTFloat               RCSG    |
|       TiDeltaF                        1.5                     |
|---------------------------------------------------------------|
| tiUseMainAttributes           NhlTBoolean             RCSG    |
|       TiUseMainAttributes             False                   |
|---------------------------------------------------------------|
| tiMainOn                      NhlTBoolean             RCSG    |
|       TiMainOn                        <Dynamic>               |
|---------------------------------------------------------------|
| tiMainString                  NhlTString              RCSG    |
|       TiMainString                    "Main"                  |
|---------------------------------------------------------------|
| tiMainSide                    NhlTPosition            RCSG    |
|       TiMainSide                      "Top"                   |
|---------------------------------------------------------------|
| tiMainPosition                NhlTPosition            RCSG    |
|       TiMainPosition                  "Center"                |
|---------------------------------------------------------------|
| tiMainOffsetXF                NhlTFloat               RCSG    |
|       TiMainOffsetXF                  0.0                     |
|---------------------------------------------------------------|
| tiMainOffsetYF                NhlTFloat               RCSG    |
|       TiMainOffsetYF                  0.0                     |
|---------------------------------------------------------------|
| tiMainJust                    NhlTJustification       RCSG    |
|       TextJustification               "CenterCenter"          |
|---------------------------------------------------------------|
| tiMainFont                    NhlTFont                RCSG    |
|       Font                            0                       |
|---------------------------------------------------------------|
| tiMainFontColor               NhlTColorIndex          RCSG    |
|       FontColor                       "Foreground"            |
|---------------------------------------------------------------|
| tiMainFontHeightF             NhlTFloat               RCSG    |
|       FontHeightF                     0.025                   |
|---------------------------------------------------------------|
| tiMainFontAspectF             NhlTFloat               RCSG    |
|       FontAspectF                     1.3125                  |
|---------------------------------------------------------------|
| tiMainConstantSpacingF        NhlTFloat               RCSG    |
|       TextConstantSpacingF            0.0                     |
|---------------------------------------------------------------|
| tiMainFontThicknessF          NhlTFloat               RCSG    |
|       FontThicknessF                  1.0                     |
|---------------------------------------------------------------|
| tiMainFuncCode                NhlTCharacter           RCSG    |
|       TextFuncCode                    :                       |
|---------------------------------------------------------------|
| tiMainFontQuality             NhlTFontQuality         RCSG    |
|       FontQuality                     "High"                  |
|---------------------------------------------------------------|
| tiMainAngleF                  NhlTFloat               RCSG    |
|       TextAngleF                      0.00                    |
|---------------------------------------------------------------|
| tiMainDirection               NhlTTextDirection       RCSG    |
|       TextDirection                   "Across"                |
|---------------------------------------------------------------|
| tiXAxisOn                     NhlTBoolean             RCSG    |
|       TiXAxisOn                       <Dynamic>               |
|---------------------------------------------------------------|
| tiXAxisString                 NhlTString              RCSG    |
|       TiXAxisString                   "XAxis"                 |
|---------------------------------------------------------------|
| tiXAxisSide                   NhlTPosition            RCSG    |
|       TiXAxisSide                     "Bottom"                |
|---------------------------------------------------------------|
| tiXAxisPosition               NhlTPosition            RCSG    |
|       TiXAxisPosition                 "Center"                |
|---------------------------------------------------------------|
| tiXAxisOffsetXF               NhlTFloat               RCSG    |
|       TiXAxisOffsetXF                 0.0                     |
|---------------------------------------------------------------|
| tiXAxisOffsetYF               NhlTFloat               RCSG    |
|       TiXAxisOffsetYF                 0.0                     |
|---------------------------------------------------------------|
| tiXAxisJust                   NhlTColorIndex          RCSG    |
|       TextJustification               "CenterCenter"          |
|---------------------------------------------------------------|
| tiXAxisFont                   NhlTFont                RCSG    |
|       Font                            0                       |
|---------------------------------------------------------------|
| tiXAxisFontColor              NhlTColorIndex          RCSG    |
|       FontColor                       "Foreground"            |
|---------------------------------------------------------------|
| tiXAxisFontHeightF            NhlTFloat               RCSG    |
|       FontHeightF                     0.025                   |
|---------------------------------------------------------------|
| tiXAxisFontAspectF            NhlTFloat               RCSG    |
|       FontAspectF                     1.3125                  |
|---------------------------------------------------------------|
| tiXAxisConstantSpacingF       NhlTFloat               RCSG    |
|       TextConstantSpacingF            0.0                     |
|---------------------------------------------------------------|
| tiXAxisFontThicknessF         NhlTFloat               RCSG    |
|       FontThicknessF                  1.0                     |
|---------------------------------------------------------------|
| tiXAxisFuncCode               NhlTCharacter           RCSG    |
|       TextFuncCode                    :                       |
|---------------------------------------------------------------|
| tiXAxisFontQuality            NhlTFontQuality         RCSG    |
|       FontQuality                     "High"                  |
|---------------------------------------------------------------|
| tiXAxisAngleF                 NhlTFloat               RCSG    |
|       TextAngleF                      0.0                     |
|---------------------------------------------------------------|
| tiXAxisDirection              NhlTTextDirection       RCSG    |
|       TextDirection                   "Across"                |
|---------------------------------------------------------------|
| tiYAxisOn                     NhlTBoolean             RCSG    |
|       TiYAxisOn                       <Dynamic>               |
|---------------------------------------------------------------|
| tiYAxisString                 NhlTString              RCSG    |
|       TiYAxisString                   "YAxis"                 |
|---------------------------------------------------------------|
| tiYAxisSide                   NhlTPosition            RCSG    |
|       TiYAxisSide                     "Left"                  |
|---------------------------------------------------------------|
| tiYAxisPosition               NhlTPosition            RCSG    |
|       TiYAxisPosition                 "Center"                |
|---------------------------------------------------------------|
| tiYAxisOffsetXF               NhlTFloat               RCSG    |
|       TiYAxisOffsetXF                 0.0                     |
|---------------------------------------------------------------|
| tiYAxisOffsetYF               NhlTFloat               RCSG    |
|       TiYAxisOffsetYF                 0.0                     |
|---------------------------------------------------------------|
| tiYAxisJust                   NhlTJustification       RCSG    |
|       TextJustification               "CenterCenter"          |
|---------------------------------------------------------------|
| tiYAxisFont                   NhlTFont                RCSG    |
|       Font                            0                       |
|---------------------------------------------------------------|
| tiYAxisFontColor              NhlTColorIndex          RCSG    |
|       FontColor                       "Foreground"            |
|---------------------------------------------------------------|
| tiYAxisFontHeightF            NhlTFloat               RCSG    |
|       FontHeightF                     0.025                   |
|---------------------------------------------------------------|
| tiYAxisFontAspectF            NhlTFloat               RCSG    |
|       FontAspectF                     1.3125                  |
|---------------------------------------------------------------|
| tiYAxisConstantSpacingF       NhlTFloat               RCSG    |
|       TextConstantSpacingF            0.0                     |
|---------------------------------------------------------------|
| tiYAxisFontThicknessF         NhlTFloat               RCSG    |
|       FontThicknessF                  1.0                     |
|---------------------------------------------------------------|
| tiYAxisFuncCode               NhlTCharacter           RCSG    |
|       TextFuncCode                    :                       |
|---------------------------------------------------------------|
| tiYAxisFontQuality            NhlTFontQuality         RCSG    |
|       FontQuality                     "High"                  |
|---------------------------------------------------------------|
| tiYAxisAngleF                 NhlTFloat               RCSG    |
|       YAxisTextAngleF                 90.0                    |
|---------------------------------------------------------------|
| tiYAxisDirection              NhlTTextDirection       RCSG    |
|       YAxisTextDirection              "Across"                |
+---------------------------------------------------------------+

Composite resources

The Title object class intercepts all the resources of its child TextItem objects. Therefore, there are no composite resources that can be set for the Title object class.

Superclass resources

You may set any resources belonging to the superclasses of the Title object class, including:


Description

Most often used as a plot annotation, the Title class draws titles around its viewport. The Title viewport is usually somewhat larger than the viewport belonging to the plot, because it may include the area occupied by other plot annotations, mostly commonly TickMark labels. Three titles can be drawn by the Title object: the Main title, the X-Axis title and the Y-Axis title. The Main title and the X-Axis titles appear either above or below the viewport, while the Y-Axis title appears to the left or right of the viewport. You can turn the individual titles on or off using the resources tiMainOn, tiXAxisOn, and tiYAxisOn. By default the Main title is centered above the viewport, the X-Axis title is centered below the viewport, and the Y-Axis title is centered to the left of the viewport. These default positions can be adjusted by various resources.

Names for the resources used to control the text attributes of the titles are derived in a consistent way from the corresponding TextItem resources: the individual title's name is prepended to the TextItem resource name. For example, the TextItem resource for setting the content string is txString. For its three titles, the Title object provides the resources tiMainString, tiXAxisString, and tiYAxisString. All other text attribute resources for the titles are constructed in the same fashion. However, note that Title uses its own scheme for positioning the titles relative to the viewport. Hence there are no resources that correspond to the TextItem txPosXF and txPosYF resources. Also, the Title object does not currently support perimeter outlines or background fill of the area occupied by the text string.

Positioning the Titles

The ti...Side resources specify on which side of the viewport the title is to appear. tiMainSide and tiXAxisSide may be set to Top or Bottom. tiYAxisSide may be set to Left or Right. The ti...Position resources specify the initial position of the title justification point along the chosen side. tiMainPosition and tiXAxisPosition allow the values Left, Center, and Right, while tiYAxisPosition accepts the values Bottom, Center, and Top.

The resource tiDeltaF applies to all the titles, and specifies, in units of the title's current font height, how far out from the viewport edge the justification point of the titles should be displaced. Note that certain settings of the justification mode, angle, and direction may result in a portion of the title overlapping the Title viewport area. In this case, the title's position is adjusted farther outward such that no part of the title text remains inside the viewport. When the X-Axis title and the Main title share the same side of the viewport, the Main title's position is established outside the X-Axis title. The outer bounding line of the X-Axis title is in effect treated as a viewport boundary for the Main title.

From the positions thus established, you can displace the individual titles in any direction using the Title offset resources, tiMainOffsetXF, tiMainOffsetYF, tiXAxisOffsetXF, tiXAxisOffsetYF, tiYAxisOffsetXF, or tiYAxisOffsetYF. Since these resources are applied after the previously mentioned adjustment, they can be used to move the titles arbitrarily. It is possible, for instance, to move a title to a location within the viewport. All the offset resources use NDC units, their positive directions coinciding with the directions of the NDC system.


Support functions

The Title object does not define any support functions, but inherits all the support functions available to its superclass.

Status


See also