Data visualization with SAS programming

SAS gplot: Inconsistent Label Sizes in SAS 9.4 Compared to SAS 9.3

Reply
Occasional Contributor
Posts: 6

SAS gplot: Inconsistent Label Sizes in SAS 9.4 Compared to SAS 9.3

[ Edited ]


I recently upgraded to SAS 9.4 and re-ran a proc gplot code to adjust label text, and I noticed that my output GIF plot had very small font sizes compared to the original plot run on SAS 9.3.

 

To get the plots looking consistent, I had to increase the size of my original label text from h=1.7 (on SAS 9.3) to h=2.6 on SAS 9.4.

Does anyone know if this is a known problem with the latest SAS upgrade or why they would be that inconsistent? Is there some sort of setting or preference that can be selected?

 

Example below. The same proc gplot code was run on SAS 9.4 (top figure) and SAS 9.3 (bottom figure). Notice how small the labels and symbols are in the top figure (9.4) as well as the width of the plot being a little wider compared to the 9.3 figure:9.4 Bad.jpg9.3 Good.jpg

 

Super User
Posts: 10,871

Re: SAS gplot: Inconsistent Label Sizes in SAS 9.4 Compared to SAS 9.3

My first guess would be that you did not have any font explicitly used in the Axis statement for the labels. When you upgraded the default ODS style used by SAS changed and therefore the font, or possibly if you are setting a style the inheritance may have changed fonts on you.

Try setting an explicit font and size in the Axis statements.

Occasional Contributor
Posts: 6

Re: SAS gplot: Inconsistent Label Sizes in SAS 9.4 Compared to SAS 9.3

I do not use a specific styling and I specify the font and height. 

 

Here are my GOPTIONS:

 

GOPTIONS RESET=ALL;
GOPTIONS DEVICE=GIF FTEXT="ARIAL" XPIXELS=1600 YPIXELS=1200
GACCESS=SASGASTD GSFNAME=GRAFOUT GSFMODE=REPLACE ROTATE=LANDSCAPE; 
FILENAME GRAFOUT "&OUTPUT.\GIF_PLOT.GIF";

Here is the beginning of my AXIS1 statement (also used in AXIS2):

AXIS1 LABEL=(F=ARIAL H=2
Super User
Posts: 10,871

Re: SAS gplot: Inconsistent Label Sizes in SAS 9.4 Compared to SAS 9.3

I think you need to investigate which ODS styles were in effect as some of the graphics options are going to interact with graphic output. Your text height is defined in character cells since you do not have a unit of measure. With the overall graph size differing, for whatever reason, then the cell size likely differs as well causing text size differences. You might want to specify an explicit measurement unit like IN, CM or PT.

 

Defining graph sizes in pixels may also be causing issues for some uses as pixel size varies from device to device and if the output is routed to PDF or RTF then it may be more of an issue. I know I had some issues transition to SAS 9 from 8 with pixel defined areas. I would investigate using VSIZE and HSIZE and set explicit measure of IN, CM or PT. I would recommend use of IN or CM which ever you think in better.

SAS Employee
Posts: 967

Re: SAS gplot: Inconsistent Label Sizes in SAS 9.4 Compared to SAS 9.3

I usually specify gunit=pct (graphical size units are specified as a percent of the page height) - otherwise the sizes can be a bit vague, and depend on the context and other settings that might or might not be in effect at the time. Or sometimes I explicitly specify a size unit when I specify a height (such as ...  title1 height=10pt "Some text"Smiley Wink

 

Here is an example showing how I usually set my goptions:

 

goptions gunit=pct htitle=4.3 htext=2.2 ftitle='albany amt/bold' ftext='albany amt';

 

New Contributor
Posts: 4

Re: SAS gplot: Inconsistent Label Sizes in SAS 9.4 Compared to SAS 9.3

[ Edited ]

Post-submission edit: The defaults are the same. Only their sequencing is different. I have still not solved the sizing problem.

 

I am currently experiencing this problem and noticed differences between the SAS 9.3 and SAS 9.4 ODS default style templates. You can see your defaults using:

PROC TEMPLATE;
SOURCE STYLES.DEFAULT /
FILE='C:\DefaultStyle.sas';
RUN;

 

Ask a Question
Discussion stats
  • 5 replies
  • 705 views
  • 1 like
  • 4 in conversation