RATS 11
RATS 11

Instructions /

GRPARM Instruction

Home Page

← Previous Next →

GRPARM( options )   pairs of: labeltype newsize

GRPARM is used to "fine tune" the appearance of a graph, allowing you to change the fonts, type sizes, or type styles used for the various graph labels. You can also use it to re-define styles to customize the appearance of lines, patterns, and symbols in your graphs.

 

Use GRPARM before issuing the GRAPH or SCATTER instructions you want to affect. All GRPARM settings remain in effect until you reset them with subsequent GRPARM instructions, or quit out of RATS. See Choosing Graph Fonts for details on how RATS handles fonts and type sizes for graph labels.

Wizard

You can use the Data/Graphics—Graph Settings operation to change these settings. If you want to permanently change the default settings, use the File—Preferences operation.

Parameters

The GRPARM parameters specify the label type or types to which the GRPARM command will apply. You can change one or more of these with a single GRPARM instruction. Separate the items with one or more spaces. You can truncate any of the parameter names to three or more characters, for instance, KEY for for KEYLABELING.

 

If you don’t want to change the size of a label (that is, if you only want to change its font or style of the label), use * for the newsize parameter. For example:

 

grparm(nobold) vlabel *

 

The choices for labeltype (with the standard values in [..]) are:

 

HEADER

The header label [24 points, bold]

SUBHEADER

The subheader label (supplied by SUBHEAD option [18,italic]

FOOTER

The footer label (supplied by FOOTER option) [18]

HLABEL

Horizontal axis label (HLABEL option) [20, bold]. Applies to HLABEL option on GBOX, GCONTOUR, GRAPH, SCATTER, and SPGRAPH.

VLABEL

Vertical axis label (VLABEL option) [20]. Applies to VLABEL option on GBOX, GCONTOUR, GRAPH, SCATTER, and SPGRAPH.

AXISLABELING

Value labels on either axis [18]

MONTHLABELS

Month titles and day numbers [14] (AXISLABELING applies to years)

KEYLABELING

Keylabels (series names or supplied by KLABELS option) [14]

MATRIXLABELS

Labels supplied by XLABELS, YLABELS on SPGRAPH [18, bold]

Options

ITALICS/[NOITALICS]

BOLD/[NOBOLD]

FONT="font name"

BOLD and ITALICS allow you to choose bold and italics styles for the label types listed on the GRPARM instruction. The FONT option allows you to specify the font used for the specified labels. See Graph Labels: Fonts and Line Breaks for more.
 

PORTRAIT/[NOPORTRAIT]

The PORTRAIT option lets you rotate subsequent graphs by 90 degrees. In combination with the Portrait/Landscape choices in the Page Setup dialog box (Windows/Macintosh versions) or the Portrait and Landscape PostScript exporting choices (all versions), this provides additional choices for orienting the graph.

 

HEIGHT=height of graph in inches [full document window]

WIDTH=width of graph in inches [full document window]

These options specify a fixed default size for subsequent graphs. You must use both options together. RATS maintains the size if you print or save the graph. Resizing the window will resize the graph proportionally. Use the "Unfix" button if you want to change the proportions. To specify sizes in centimeters, use the %CM() function to convert centimeters to inches.

 

PATTERNS/[NOPATTERNS]

Use the PATTERNS option if you want graphs to be drawn in black and white rather than in color. Note that you can also use the  or  (the button switches between the two) to switch from color to black-and-white mode and back.

 

RGF/[NORGF]

RGF selects use of the older RGF format rather than newer RGFZ format for creating graphs.

 

DEFINE="style definition"

style definition is a string which re-defines one of the line, fill or symbol styles, for instance, DEFINE="LINE_BW_2=0,.75,3.0" defines black and white line style 2 as a medium gray solid line with 3 times the standard width.

 

IMPORT=unit from which to import graph style sheet definitions

This option is the older method for creating custom definitions for line, fill, and symbol styles—the DEFINE option is now preferred. See Style Definitions.

 

RECALL=VECT[INTEGER] saved by %GRPARM function

The %GRPARM() function returns a VECTOR containing the current set of font size and style definitions. If you have saved this information into a vector earlier in the session, you can revert back to those settings by using the RECALL option.

For example, if you do:

 

compute fontstyles = %grparm()

 

You can revert back to those settings later by doing:

 

grparm(recall=fontstyles)

 

BACKGROUND=stylenum

This allows you to choose a background for the main box of the graph other than the default choice, which is a solid white background. The stylenum is one of the color fills—you can select from one of the default style choices, or a custom style.

 

SHADING=stylenum

This allows you to choose a different style for the SHADING (on GRAPH) or VSHADE or HSHADE (on SCATTER and GCONTOUR). The default is a very light solid gray. The stylenum is one of the color fills—you can select from one of the default style choices, or a custom style.

 

GRID=stylenum

This allows you to choose a different style for the GRID or VGRID options (on GRAPH), VGRID or HGRID (on SCATTER and GCONTOUR) or VGRID (on GBOX). The default is a "hairline" (very thin) solid black. The stylenum is one of the color fills—you can select from one of the default style choices, or a custom style.

 

CMLABELS=VECTOR[STRING] with short (one or two character) month labels

SMLABELS=VECTOR[STRING] with short (roughly 3 character) month labels

LMLABELS=VECTOR[STRING] with full month names

These were added with version 9.1. They allow you to localize the labeling of months in graphs. The default is the standard English names and abbrevations. For instance,

 

grparm(cmlabels=||"E","F","M","A","M","J","J","A","S","O","N","D"||)

grparm(smlabels=||"enero","feb","marzo","abr","mayo","jun","jul","agosto","set","oct","nov","dec"||)

grparm(lmlabels=||"enero","febrero","marzo","abril","mayo","junio","julio",$

   "agosto","septiembre","octubre","noviembre","deciembre"||)

 

would use Spanish month names and abbreviations instead. Note that the graphs themselves don't have the labels built in—instead, they save the raw date information. The substitution is done whenever any graph is displayed, printed or exported after the GRPARM instruction.

Notes on Font Sizing

RATS automatically scales labels to fit the overall graph size, with default sizes based on a full-page (10" x 8") graph. If you take a full sized graph and make it smaller, the fonts will be reduced proportionally. If you want a label to be larger or smaller than it appears, set a new size relative to the default size.

For example, suppose you do an SPGRAPH with four graphs on a page, where each graph has its own header. RATS will automatically scale the header down from 18 points to an apparent size of about 8 or 9 points. To select a slightly larger header, you might try GRPARM HEADER 20 (larger relative to the 18 point default), not GRPARM HEADER 12, which would produce smaller headers.

Examples

grparm(bold) hlabel 16 matrixlabels 14 header 18

grparm  axislabel 36

 

This resets several label sizes, including switching the first three to bold.


 

grparm axislabel 18 header 30

grparm(italics) subheader 22

graph(extend, $

  header="Canadian - US Exchange Rate",sub="Can $/US $") 1

# canusx 1978:1 2002:12


This increases the sizes of the axis, header and subheader labels.


 

compute grparms = %grparm()

grparm(font="Symbol") axislabels *

spgraph

scatter(style=line,key=upleft,header="Cumulated Periodogram Test",xlabels=||"0","p/4","p/2","3p/4","p"||) 2

# freqs white_noise 1 half

# freqs actual      1 half

display(store=gaplabel) "gap = " #.#### %maximum

if actual(%maxent)<white_noise(%maxent)

   grtext(alignment=left,x=%maxent-1,y=actual(%maxent)-.01) gaplabel

else

   grtext(alignment=right,x=%maxent-1,y=actual(%maxent)+.01) gaplabel

spgraph(done)

grparm(recall=grparms)

 

This saves the current graph parameters, resets the AXISLABELS to be the symbol font (without changing the size). That applies to the XLABELS on the SCATTER instruction so p/4 for instance will display as \(\pi/4\). The final GRPARM resets the values.


 


Copyright © 2025 Thomas A. Doan