SAS Device Drivers: Understanding Device Parameters and GOPTIONS in SAS/GRAPH - Prof. Merv, Study notes of Statistics

The concept of sas device drivers, focusing on the role of executable programs and device entries, device parameter settings, and the use of goptions statement in sas/graph. It covers topics like hsize, vsize, xmax, ymax, device resolution, cells, and graphic output area placement.

Typology: Study notes

Pre 2010

Uploaded on 09/02/2009

koofers-user-lry
koofers-user-lry 🇺🇸

5

(1)

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SAS Device Driver consists of an executable program and a
device entry that contains a set of setting for the device parame-
ters (e.g., HSIZE=, etc) that determine the default appearance
of graphic output on a particular device.
GOPTIONS statement and options in SAS/GRAPH proce-
dure statements allow the user to override these device para-
meter settings for the duration of a SAS session until the user
resets them or change them by executing another GOPTIONS
statement.
SAS Graph obtains these values from the device driver for the
default device or a specified device for producing graphics output
to be displayed on that device.
Device parameters XMAX= and YMAX= determine the size of
the display area for a device. For a monitor the display area is
the same as the graphics output area. For a hardcopy device,
such as graphics printers and plotters, HSIZE= and VSIZE=
define a smaller area, so a margin is possible.
The user can change the size of the graphics output area by
specifying new values for HSIZE=, VSIZE= in a GOPTIONS
statement or other SAS/GRAPH procedure statements. For a
monitor display device HSIZE=, VSIZE= are set to zero be-
cause the entire area of a graphics window is used to display the
graphics output.
Device Resolution is the number of pixels/inch defined for
a particular device, in both vertical and horizontal directions.
For e.g., the PSCOLOR device driver setting defines the x-
resolution to be 300 pixels/inch (or 300 dpi for dots per inch) i.e.
3300pixels/11.00inches. Changing HSIZE=, VSIZE= will not
affect the resolution.
Cells control the size of graphic elements i.e., TITLEs, SYM-
BOLs, LABELs etc. The size of a cell is defined by the the set-
tings for device parameters (LROWS=, LCOLS= ) for landscape
mode, and (PROWS=, PCOLS= ) for portrait mode. These
settings are usually overridden by HPOS= (which overrides
LCOLS=, PCOLS= ) and VPOS= (which overrides PROWS=,
LROWS=) in the GOPTIONS statement. (Thus changing
HPOS=, VPOS= changes the cell size.)
By default SAS/GRAPH uses units in CELL size to draw graphic
elements. For e.g., character heights for TITLE1 are two CELL
units. Since changing cell size will affect the appearance of
graphic elements, absolute units like IN or CM may be used.
Graphic elements are placed in the graphic output area as shown
in Figure 2.6
The user’s SAS program
?
SAS/GRAPH
?
Device-independent
Graphic Output
Generic commands that
generate graphic elements
like points, lines, text etc.
?
SAS/GRAPH
?
Device Driver -
Device-dependent
Graphic Output
?
Hardcopy
Device
HHHHHHHHHHHHH
Hj
File
Monitor
i.e., graphics printer,
plotter etc.
Graphic Output Area
vsize=8.5 in
6
?
hsize=7.5 in -
xmax=10.0 in -
ymax=11.0 in
6
?
Graphics Output Area
pf3
pf4
pf5

Partial preview of the text

Download SAS Device Drivers: Understanding Device Parameters and GOPTIONS in SAS/GRAPH - Prof. Merv and more Study notes Statistics in PDF only on Docsity!

  • SAS Device Driver consists of an executable program and a device entry that contains a set of setting for the device parame- ters (e.g., HSIZE=, etc) that determine the default appearance of graphic output on a particular device.
  • GOPTIONS statement and options in SAS/GRAPH proce- dure statements allow the user to override these device para- meter settings for the duration of a SAS session until the user resets them or change them by executing another GOPTIONS statement.
  • SAS Graph obtains these values from the device driver for the default device or a specified device for producing graphics output to be displayed on that device.
  • Device parameters XMAX= and YMAX= determine the size of the display area for a device. For a monitor the display area is the same as the graphics output area. For a hardcopy device, such as graphics printers and plotters, HSIZE= and VSIZE= define a smaller area, so a margin is possible.
  • The user can change the size of the graphics output area by specifying new values for HSIZE=, VSIZE= in a GOPTIONS statement or other SAS/GRAPH procedure statements. For a monitor display device HSIZE=, VSIZE= are set to zero be- cause the entire area of a graphics window is used to display the graphics output.
  • Device Resolution is the number of pixels/inch defined for a particular device, in both vertical and horizontal directions. For e.g., the PSCOLOR device driver setting defines the x- resolution to be 300 pixels/inch (or 300 dpi for dots per inch) i.e. 3300 pixels/ 11. 00 inches. Changing HSIZE=, VSIZE= will not affect the resolution. - Cells control the size of graphic elements i.e., TITLEs, SYM- BOLs, LABELs etc. The size of a cell is defined by the the set- tings for device parameters (LROWS=, LCOLS= ) for landscape mode, and (PROWS=, PCOLS= ) for portrait mode. These settings are usually overridden by HPOS= (which overrides LCOLS=, PCOLS= ) and VPOS= (which overrides PROWS=, LROWS=) in the GOPTIONS statement. (Thus changing HPOS=, VPOS= changes the cell size.) - By default SAS/GRAPH uses units in CELL size to draw graphic elements. For e.g., character heights for TITLE1 are two CELL units. Since changing cell size will affect the appearance of graphic elements, absolute units like IN or CM may be used. - Graphic elements are placed in the graphic output area as shown in Figure 2.

The user’s SAS program

^  

 

SAS/GRAPH

 Device-independent Graphic Output

Generic commands that generate graphic elements like points, lines, text etc.

  

 

SAS/GRAPH



Device Driver 

Device-dependent Graphic Output

 







Hardcopy Device

    





 File

^      





 Monitor i.e., graphics printer, plotter etc.

Graphic Output Area

vsize=8.5 in





^ hsize=7.5 in^ 

^ xmax=10.0 in^ 

ymax=11.0 in





 (^) Graphics Output Area

Placement of Graphic Elements

 (^) Graphics Output Area

 (^) Output of SAS/GRAPH p

  

Titles appear here (by default)

 

 Footnotes appear here (by default)

GOPTIONS options ; cback= specify background color, for use with termi- nal/monitor (usually ignored by hardcopy device) colors=( ) default colors list: colors used for various elements of a graph separated by blanks. This list will be used if colors for these elements are not specified explicitly in SAS/GRAPH statements. This list overrides the colors list of the current device driver (see for e.g., Fig. ??) ftext= default font to be used for all text ctext= default color to be used for all text in the graph gunit= pct, in, cm or cell; unit for text height in title, note, footnote, symbol, axis, and legend state- ments; cell is the default unit if not specified here vpos= number of cells in vertical axis (10 to 300) hpos= number of cells in horizontal axis (10 to 300) hsize= in inches } specify size of display area. vsize= in inches device= device-driver-name e.g., ps300, pscolor, hp7480a, hplj4si, x4045p, etc. (Execute proc gdevice to view the complete list of device drivers supported in SAS/GRAPH) targetdevice= specify intended hardcopy device to display graph on the monitor as it would appear on that device (may not be an exact reproduction but SAS will duplicate it as close as possible) gaccess= specifies format and destination of graphics stream e.g., gsasfile gsfname= specifies graphics stream file name

PROC GPLOT < data=> < gout=> < annotate=> ;

PLOT plot-request(s) ... / AXIS statement SYMBOLstatement PATTERNstatement TITLE statement FOOTNOTE statement NOTE statement BY statement

PLOT statement options:

vaxis=value-list vminor=n haxis=value-list hminor=n vm=n hm=n vaxis=axis-definition haxis=axis-definition overlay nolegend noaxes legend=legend-definition areas=n frame cframe=colorcaxis=color ctext=color fr cfr=color ca=color ct=color annotate=data-set-name anno=data-set-name href=value-list chref=color lhref=line-type ch=color lh=line-type vref=value-list cvref=color lvref=line-type cv=color lv=line-type

TITLEn <text-string> <text-string>... ; FOOTNOTEn <text-string> <text-string>; NOTEn <text-string> <text-string>... ; color= specify color for the text string that follows; red, c= blue, green, black, violet, etc. or SAS colors like lightpink, mistyrose, or steelblue. Default: first color in colors list or first default color for device font= specify font for the text string that follows; swiss, f= triplex, greek, math, italic etc. Default: complex for title1 and none for all other text. Spec- ifying none causes the default hardware font for the output device to be used height= text height specified as n in, n cm, n pct, n cells, or n h= with units unspecified. Default: the unit specified in gunit= in goptions or cells justify alignment of text string l, r, or, c, for left-, right-, j= or center-justify Default: c angle= angle in degrees displayed in the range -90 to 90 a= move= (x, y) co-ordinates of starting location of text string, m= specified using units, as in h= e.g., (1,2) in, ( cm, 3 pct); can be specified as relative co-ordinates, (±x, ±y), starting from the end of last text line drawn in the current statement. lspace= line space; space above a title or below footnotes to be ls= left blank; specified using units as in h= underlin=underline text string; 0, 1, 2, or, 3 specifies thickness of line. u= box= draw box around text string 1, 2, 3, or, 4 specifies thickness of line.

PROC GCHART < data=> < gout=> < annotate=> ;

HBAR chart variable(s) / VBAR chart variable(s) / BLOCK chart variable(s) / PIE chart variable(s) / STAR chart variable(s)/ AXIS statement PATTERNstatement TITLE statement FOOTNOTE statement NOTE statement BY statement

Options for HBAR include:

ascending descending noheading nolegend freq cfreq percent cpercent mean sum nostats axis=value-list raxis=value-list maxis=axis-definition axis=axis-definition raxis=axis-definition group=variable subgroup=variable sumvar=variable type=statistic discrete levels=number midpoints=value-list frame caxis=color ctext=color cframe=color coutline=color patternid=method legend=legend-definition name=quoted-string

PATTERNn options ; color= color for the bar or subgroup; if color is not specified c= the pattern statement will be repeated for each color in the colors list value= pattern for the bar/block, map/plot or pie/star as described in the text v= repeat= number of times same pattern statement is to be reused r=

Roman text fonts Character set for the Greek font

Line types for style= and line= options

Character set for the Math font

Character set for the special font

A subset of special symbols for plotting points

Plot Plot value= Symbol value= Symbol plus + hash # x × point · star ∗ dot • square  circle ◦ diamond  - (i.e.,hyphen)  triangle  + (i.e.,plus) ⊕

Set value= option exactly as shown and omit the font specification

Pattern statement: setting the value= option