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:
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.
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
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.
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";)
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';
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.