Object Reference : Object View and Procedure Reference : Graph
Sets custom axis labels for the observation scale of a graph.
graph_name.setobslabel([step_options,] init_options) [string1 string2 ...]
Follow the keyword with a list of axis labels, or the name of a series when the “series” init_option is used.
To preserve case, enclose the label in quotation marks. To hide a label, use “”. If the number of labels provided is less than the number of existing labels, the remaining labels will not be affected.
Step options
start[, step]
start should be the observation number of the first label to modify. step defines the number of observations to skip between applying labels.
Init options
init_options (default = “blank”)
init_options sets initialization options for the labels.
For a frozen graph (updating off), you may use the keywords:
“current” (keep current labels, or initialize the labels with standard observation labels if custom labels do not currently exist, then add the labels provided),
“obsnum” (initialize with observation numbers), or
“blank” (set all labels to empty strings, then add the labels provided).
For live or frozen graphs, you may use the keywords:
“series” (initialize the labels with the values of a series; follow the command with the name of a series instead of labels), or
“clear” (delete custom labels if they exist and return to automatic labeling).
Given a graph GRA1 with updating turned off, change the first label to “CA” using the command:
gra1.setobslabel(current) "CA"
Note that all but the first label remain unchanged.
To keep the first label as “CA” and set the second label to “OR”, you could enter:
gra1.setobslabel(current) "CA" "OR"
Alternatively, an equivalent command would be
gra1.setobslabel(2,current) "OR"
which starts applying labels at the second observation.
To set the first, third, and fifth observation labels in the frozen graph GRAPH2 and leave all others unchanged:
graph2.setobslabel(1,2,current) "first" "third" "fifth"
This instructs EViews to begin modifying at the first label and step two observations between new labels.
graph2.setobslabel(1,2,blank) "first" "third" "fifth"
performs the same operation as the previous command, while also clearing out all other labels.
deletes all custom labels and returns to EViews automatic labeling.
Say we have an alpha series in our workfile, ALPHA01, whose values are: “CA”, “OR”, “WA”, etc. To use these values as axis labels, use the series option and specify a series name in place of labels:
gra3.setobslabel(series) alpha01
This command creates labels on the time axis, using values in ALPHA01 to label the observations with: “CA”, “OR”, “WA”, etc.
See “Graph Objects” for a discussion of graph options.
See also Graph::datelabel, Graph::axis, Graph::options and Graph::setelem.