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=;
define style styles.source_u;
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);
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.
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.
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!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.