BookmarkSubscribeRSS Feed
Snehal
Obsidian | Level 7

Hi,

 

I had produced a graph rtf with goptions and gplot, now I need to use sgplot for generating graph. For the purpose of consistency across rtfs, I need the appearance of graph font, font size to be exactly same.

 

To control font attributes, with PROC GPLOT I was using;

goptions reset=all ftext=simplex ftitle=simplex htext=1 htitle=1 xmax=10in ymax=6.5in ;

 

with PROC SGPLOT I am using following template update with ODS RTF style=;

proc template;
   define style styles.source_u;
   parent=styles.source;
  
   style graphfonts from graphfonts /
         'GraphDataFont'     = ("simplex, <sans-serif>", 8pt)
         'GraphUnicodeFont'  = ("simplex, <sans-serif>", 8pt)
         'GraphValueFont'    = ("simplex, <sans-serif>", 8pt)
         'GraphLabel2Font'   = ("simplex, <sans-serif>", 8pt)
         'GraphLabelFont'    = ("simplex, <sans-serif>", 8pt)
         'GraphFootnoteFont' = ("simplex, <sans-serif>", 8pt)
         'GraphTitleFont'    = ("simplex, <sans-serif>", 8pt)
         'GraphTitle1Font'   = ("simplex, <sans-serif>", 8pt)
         'GraphAnnoFont'     = ("simplex, <sans-serif>", 8pt);            
   end;
run;   

 

Using SAS Version 9.04.01M3

 

Though the look is similar, its not exactly the same. One thing is that text height in goptions is 1 (gunit=cells), what is the equivalent in pt? Secondly the font appears slightly dark boldiesh with GPLOT and thin sharp with SGPLOT. 

 

How can I have the exact appearance with SGPLOT.

2 REPLIES 2
ballardw
Super User

To get "exact" appearance may not be possible without dealing with a lot of "fiddly bits". It might be easier to go back and recreate the previous documents with the settings you choose.

 

As a minimum you need to specify 1) your current GDEVICE settings; 2) all goptions used; 3) Axis, Symbol and Pattern statements; and 4) code for the SAS/Graph procedure(s) of interest. And hope someone with enough knowledge of those options is willing to spend the time to try to create such a code conversion.

 

There really is not going to be a direct map from "unit" to text attributes as "unit" is a DEVICE setting.

 

 

There are additional font attributes such as font weight that are available but not all supplied fonts have all "weights" in their definitions so matches may be problematic normal and bold are usually available.

Also you may need to examine the GraphAnnoText style element as different elements may use different fonts.

DanH_sas
SAS Super FREQ

I think the main problem here is that you cannot use the SIMPLEX font with ODS Graphics. YOu can use only TrueType fonts. SIMPLEX is an older SAS/Graph font. What is probably happening in your case is that SIMPLEX is working for your SAS/Graph procs, but the next font in the "cascade" is being used for ODS Graphics (<san-serif> is probably picking up Arial or Albany AMT, depending on your OS). To make things consistent, you'll need to use a TrueType font for everything.

 

My suggestion would be to remove the FTEXT and FTITLE from GOPTIONS and remove SIMPLEX from your custom style. Then, all of your output should get the same font.

 

Hope this helps!

Dan

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1367 views
  • 2 likes
  • 3 in conversation