Data visualization with SAS programming

Setting GUNIT in GOPTIONS

Reply
Occasional Contributor
Posts: 17

Setting GUNIT in GOPTIONS

Questions on Setting GUNIT in GOPTIONS

Dear All.

Based on SAS/GRAPH 9.3 Referece (SAS Institute, 2012), if the HSIZE= and VSIZE= options are specified then GUNIT is ignored and inches will be used in GOPTIONS. However, when HSIZE= and VSIZE= options are specified different figure size are produced using GUNIT = PCT (Figure 1) and using default GUNIT (not specified). It seems "if the HSIZE= and VSIZE= options are specified then GUNIT is ignored and inches will be used" is not true? Anyone know why? Codes are included below.


Many Thanks,

Charlie

** Figure 1: Use GUNIT = PCT with VSIZE and HSIZE specified;

%LET FONTNAME = Times;

goptions

  reset  = all          

  GUNIT=PCT

  rotate  = landscape    

  hsize   = 8 in

  horigin = 0 in          

  vsize   = 6.5 in          

  vorigin = 0 in         

  ftext   = "&FONTNAME"   

  htext   = 10pt          

  ftitle  = "&FONTNAME"   

  htitle  = 10pt    

;

SYMBOL H=3 C=BLUE CO=BLUE INTERPOL=NONE VALUE= circle ;

AXIS1 OFFSET=(1,1) ORDER=(50 to 150 by 10) LABEL=(FONT="&FONTNAME" h=2.5

      ANGLE=90 "Wright (Kg)") VALUE=(H=2.5) MINOR=NONE;

AXIS2  OFFSET=(1,1) ORDER=(50 to 80 by 5) LABEL=(FONT="&FONTNAME" h=2.5

      "Height (cm)") VALUE=(H=2.5) MINOR=NONE;

title &FMTTITLE. "Figure 1. Scatter Plot for Weight by Height"; 

PROC GPLOT DATA=sashelp.class;

  PLOT weight*height/ HAXIS=AXIS2 VAXIS=AXIS1 noframe nolegend ;

RUN;

** Figure 2: Use default GUNIT with VSIZE and HSIZE specified;

goptions

  reset  = all        

  GUNIT=IN

  rotate  = landscape      

  hsize   = 8 in

  horigin = 0 in          

  vsize   = 6.5 in          

  vorigin = 0 in         

  ftext   = "&FONTNAME"   

  htext   = 10pt          

  ftitle  = "&FONTNAME"   

  htitle  = 10pt    

;

SYMBOL H=3 C=BLUE CO=BLUE INTERPOL=NONE VALUE= circle ;

AXIS1 OFFSET=(1,1) ORDER=(50 to 150 by 10) LABEL=(FONT="&FONTNAME" h=2.5

      ANGLE=90 "Wright (Kg)") VALUE=(H=2.5) MINOR=NONE;

AXIS2  OFFSET=(1,1) ORDER=(50 to 80 by 5) LABEL=(FONT="&FONTNAME" h=2.5

      "Height (cm)") VALUE=(H=2.5) MINOR=NONE;

title &FMTTITLE. "Figure 2. Scatter Plot for Weight by Height"

PROC GPLOT DATA=sashelp.class;

  PLOT weight*height/ HAXIS=AXIS2 VAXIS=AXIS1 noframe nolegend ;

RUN;

Ask a Question
Discussion stats
  • 0 replies
  • 634 views
  • 0 likes
  • 1 in conversation