Adjusting Graph Elements

In this section:

All graphs other than pie charts have horizontal and vertical axes. These axes usually have scales with adjustable upper and lower thresholds that are divided into class intervals representing quantities of data (scales are only provided when the variables named are computational fields). Class intervals are further broken down with tick marks representing smaller increments of data.

When multiple graphs are created in a single request, FOCUS determines the default horizontal scale after examining all values to be plotted, and the same scale is then applied to each graph. Vertical scales are recalculated each time, however, and adjusted for the values in each graph (unless you override this feature).

Some graph forms, notably connected point plots, histograms, and bar charts, can be visually strengthened by adding parallel lines across the horizontal and/or vertical axes, to form a grid against which the data is arrayed.

The following describes the default conditions for all of these graph features, and the facilities for changing the default values to create customized output.

At any time during your session, you can review the current GRAPH parameter settings by typing:

? SET GRAPH

which displays the current settings of all of the adjustable GRAPH parameters, as shown below.

Parameter

Setting

DEVICE

IBM3270

GPROMPT

OFF

GRID

OFF

VGRID

OFF

HAXIS

130

VAXIS

66

GTREND

OFF

GRIBBON (GCOLOR)

OFF

VZERO

OFF

VAUTO

ON

VMAX

.00

VMIN

.00

HAUTO

ON

HMAX

.00

HMIN

.00

AUTOTICK

ON

HTICK

.00

HCLASS

.00

VTICK

.00

VCLASS

.00

BARWIDTH

1

BARSPACE

0

BARNUMB

OFF

HISTOGRAM

ON

HSTACK

OFF

BSTACK

OFF

PIE

OFF

GMISSING

OFF

GMISSVAL

.00

For information about each of the parameters listed, refer to SET Parameters.

The Horizontal Axis: System Defaults

How to:

The width of each graph, including any surrounding text, is controlled by the HAXIS parameter. For online displays, FOCUS automatically detects the terminal width and plots the graph accordingly.

For graphs generated OFFLINE, the default value for HAXIS is normally set to the maximum possible size for the output device selected, after allowing for the inclusion of any text required for the vertical axis and its labels along the left margin. To maximize display space, you can limit the size of your labels through the use of either AS phrases or DECODE expressions.

In setting the scale (when AUTOTICK=ON, and HAUTO=ON), FOCUS determines the amount of available space and the range of values selected for plotting. It then selects minimum, intermediate, and maximum unit values for the horizontal axis scale that encompass the range of values and are convenient multiples of an appropriate power of 10 (10 vs. 1000 vs. 1,000,000).

When you select a high-resolution graphic device, FOCUS controls the axis dimensions according to the values shown for the various devices in SET Parameters.

Syntax: How to Set the Width

To set the width of the graph to a given number of characters, issue the SET statement

SET HAXIS=nn

where:

nn

Is a numeric value between 20 and 130.

Syntax: How to Set the Scale: Assigning Fixed Limits

FOCUS automatically sets the horizontal scale to cover the total range of values to be plotted (HAUTO=ON). The range is divided into intervals called classes. The scale is normalized to provide class values rounded to the appropriate multiples and powers of 10 for the intervals plotted on the axis.

If you wish to assign fixed upper and lower limits (useful when producing a series of graphs where consistent scales are needed), turn off the automatic scaling mechanism, and set new limit values. This is done with the SET command. The syntax is:

SET HAUTO=OFF, HMAX=nn, HMIN=nn

where:

HAUTO

Is the automatic scaling facility.

HMAX

Is the parameter for setting the upper limit on the horizontal axis. The default is 0.

HMIN

Is the parameter that controls the lower limit on the horizontal axis when HAUTO is OFF. The default is 0.

nn

Is the new limit.

Note:

  • When entering several SET parameters on one line, separate them with commas.
  • If you define limits that do not incorporate all of the data values, FOCUS displays OVER and/or UNDER to indicate that some of the data extracted is not reflected on the graph.

Syntax: How to Set Class and Tick Intervals

Class intervals are the intervals between the labels and grid lines on a graph. Tick intervals are the subdivisions of class intervals. When AUTOTICK is ON, FOCUS automatically determines the class and tick intervals.

To set the class and tick intervals yourself, first turn off the default scaling mechanism, then reset the class and tick intervals with the SET command

SET AUTOTICK=OFF, HCLASS=nn, HTICK=nn

where:

AUTOTICK

Is the automatic scaling mechanism.

HCLASS

Is the parameter that controls the class interval on the horizontal axis when AUTOTICK is OFF. The default is 0.

nn

Is the new class interval value for the axis.

HTICK

Is the parameter that controls the tick interval when AUTOTICK is OFF. The default is 0.

nn

Is the new tick interval for the axis.

Note:

  • When issuing more than one parameter with a sample SET command, separate parameters with commas as shown above.
  • To make the changes apparent on the screen, SET SCREEN to PAPER.
  • The number of ticks per class is HCLASS/HTICK.

The Vertical Axis: System Defaults

How to:

The vertical axis (VAXIS) represents the number of lines in the graph, including any surrounding text.

For online displays, FOCUS automatically plots the graph according to the terminal height. For graphs generated offline, FOCUS respects VAXIS settings.

FOCUS automatically sets the vertical scale to cover the total range of values to be plotted (VAUTO=ON). The height is set as high as possible, taking into consideration any headings and/or footings, and the need to provide suitably rounded vertical class markers.

The range is divided into intervals called classes. The scale is normalized to provide class values rounded to the appropriate multiples and powers of 10 for the intervals plotted on the axis.

As with the horizontal axis, FOCUS selects the vertical axis size whenever you select a high-resolution graphic device (see SET Parameters).

Syntax: How to Set the Height

Use the following SET command to set the vertical axis:

SET VAXIS=nn

where:

nn

Is a number in the range 20-66.

Syntax: How to Set the Scale: Assigning Fixed Limits

If you wish to give the vertical scale fixed upper and lower limits (useful when producing a series of graphs where consistent scales are needed), turn off the automatic scaling mechanism, and set fixed limits. This is done with the SET command:

SET VAUTO=OFF, VMAX=nn, VMIN=nn

where:

VAUTO

Is the automatic scaling facility.

VMAX

Is the parameter for setting the upper limit on the vertical axis. The default is 0.

VMIN

Is the parameter that controls the lower limit on the vertical axis when VAUTO is OFF. The default is 0.

nn

Is the new limit.

Note:

  • When entering several SET parameters on one line, separate them with commas.
  • If you define limits that do not incorporate all of the data values, FOCUS displays OVER and/or UNDER to indicate that some of the data extracted is not reflected on the graph.

Syntax: How to Set Class and Tick Intervals

To set the class and tick intervals on the vertical axis, first turn off the default scaling mechanism, and then reset the class and tick intervals with the SET command:

SET AUTOTICK=OFF, VCLASS=nn, VTICK=nn

where:

AUTOTICK

Is the automatic scaling mechanism.

VCLASS

Is the parameter that controls the class interval on the vertical axis when AUTOTICK is OFF. The default is 0.

nn

Is the new class interval for the vertical axis.

VTICK

Is the parameter that controls the tick interval when AUTOTICK is OFF. The default is 0.

nn

Is the new tick interval for the axis.

Note:

  • When setting more than one parameter, separate them with commas.
  • To make the changes apparent on screen, SET SCREEN to PAPER.
  • The number of ticks per class is VCLASS/VTICK.

Highlighting Facilities

How to:

FOCUS contains the following facilities for highlighting the information shown on your graphs:

Syntax: How to Add Horizontal or Vertical Grids

Grids often make graphs easier to read. They are parallel lines drawn across the graph at the vertical and/or horizontal class marks on the axes.

Horizontal grid lines are available on connected point plots, histograms, and scatter diagrams. To add them at the vertical class marks on your graph, issue the following:

SET GRID=ON

Vertical grid lines are available only on high-resolution devices in requests for connected point plots and scatter diagrams, and only when the values on both axes are numeric. To add them at the horizontal class marks on the graph, issue the following:

SET VGRID=ON

To remove the lines, set the appropriate parameter OFF.

Syntax: How to Add Summary Numbers in Pie and Bar Charts

To print a summary number at the end of each bar on a bar chart or in each slice of a pie chart, set the parameter BARNUMB:

SET BARNUMB=ON

These summary numbers are not available on histograms.

Syntax: How to Add Trend Lines on Scatter Plots

Trend lines are useful on scatter plots to give a focus to the sometimes confusing array of plot points. The trend line represents the notion of the "best fit" calculated by Ordinary Least Squares (OLS) regression analysis.

When two data fields are scattered across the same horizontal axis, each is given its own trend line. On some terminals with two-color ribbons, the lines are differentiated by color.

The system always requests a value for the parameter GTREND, whenever a scatter diagram is requested (the default value for GTREND is OFF). To request a trend line, set GTREND on:

SET GTREND=ON

Information Builders