Hi,
I'm creating a graph using Proc SGPLOT. I'm adding this graph to a RTF document. I have attached my code as well as a screen snapshot of the graph.
Thank you very much for your guidance!
SM
Great! Then, this will be straightforward:
1. To get rid of the outer border, use the NOBORDER option on the ODS GRAPHICS statement:
ods graphics / noborder;
2. Use the BACKCOLOR option on the STYLEATTRS statement in PROC SGPLOT to set a background color:
proc sgplot data=whatever;
styleattrs backcolor=cxffffff;
hbar ... ;
run;
Other related options that might interest you are the WALLCOLOR option on the STYLEATTRS statement, as well as the NOWALL and NOBORDER options on the PROC SGPLOT statement. These "NO" options control the visibility of the wall fill area (NOWALL) and the wall border (NOBORDER).
Hope this helps!
Dan
Hi,
Now you are using SGPLOT, try to use the option TMPLOUT= to export the SGPLOT template and then try to add this option BACKGROUNDCOLOR= style-reference | color.
Please clarify
Hi smajid,
Yes, with TMPLOUT a .sas file is generated. This sas file contain the proc template necessary to generate the shell to produce your output. You could modify this code, including the background. Each proc template give a name to the shell.
proc template;
define statgraph _TMPLNAME_;
After that, you could use a proc sgrender to use your original dataset and your modified template to produce the desired output.
proc sgrender data=_IN_ template=_TMPLNAME_;
run;
I hope that it is now clearer
What version of SAS are you using? There have been options added to SGPLOT that can do both of your items in a straightforward way.
DanH_sas,
Thank you for your response!
I'm using SAS Studio v3.5. The sas engine is: SAS release: 9.04.01M3P06242015
It is the SAS OnDemand for Academics.
Great! Then, this will be straightforward:
1. To get rid of the outer border, use the NOBORDER option on the ODS GRAPHICS statement:
ods graphics / noborder;
2. Use the BACKCOLOR option on the STYLEATTRS statement in PROC SGPLOT to set a background color:
proc sgplot data=whatever;
styleattrs backcolor=cxffffff;
hbar ... ;
run;
Other related options that might interest you are the WALLCOLOR option on the STYLEATTRS statement, as well as the NOWALL and NOBORDER options on the PROC SGPLOT statement. These "NO" options control the visibility of the wall fill area (NOWALL) and the wall border (NOBORDER).
Hope this helps!
Dan
DanH_sas,
Thank you very much! I tried your two recommendations and they worked. Appreciate your help a lot!
SM
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.