Hello!
I've very new to creating graphics in SAS, here is what I have:
The main things I would like to do are:
1.) Move the headers to above the "Age at Death (years)" label, I was able to make it a footnote as a work around, but it wasn't centered with the panels.
2.) Change the color of the headers to white and remove the outline, I've tried adding HEADERBACKCOLOR=white and NOHEADERBOARDER to the panelby statement. HEADERBACKCOLOR=white throws a syntax error. NOHEADERBOARDER deleted the headers entirely.
3.) Not as desired as the others, but I'd like a very small white space between each year instead of them being side by side. I've tried altering BARWIDTH= in the colaxis statement with no effect.
I'm using SAS 9.4 TS level 1M2 with ODS Graphics on.
Code:
proc sgpanel data=w.figure2sample2 noautolegend;
where deathcategory_4 = 'CVD';
title 'Number of Deaths by Category Aged 25 and Older by 10-Year Intervals, 1964-2019';
title2 'Cardio Vascular Disease' ;
panelby agegroup / layout=columnlattice onepanel novarname noborder colheaderpos=bottom headerattrs=(size=8pt);
vbar year / groupdisplay=cluster fillattrs=(color=grey) outlineattrs=(color=grey) ;
colaxis display=(NOTICKS) fitpolicy=none label='Age at Death (years)'
valueattrs=( size=6pt )
values=(1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019)
valuesdisplay=("" "" "" "" "" "" "1970" "" "" "" "" "" "" "" "" "" ""
"" "" "" "" "" "" "" "" "" "1990" "" "" "" "" "" "" "" "" ""
"" "" "" "" "" "" "" "" "" "" "2010" "" "" "" "" "" "" "" "" "");
rowaxis label='Number of Deaths';
run;
Any help is greatly appreciated!
It could be easier to output a simple slide with just the graph and no border to PowerPoint and edit it there.
ods graphics/noborder;
options nodate nonumber;
ods powerpoint file ="C:\Users\User\Desktop\example.pptx" ;
***simplified sgpanel code***;
ods powerpoint close;
It could be easier to output a simple slide with just the graph and no border to PowerPoint and edit it there.
ods graphics/noborder;
options nodate nonumber;
ods powerpoint file ="C:\Users\User\Desktop\example.pptx" ;
***simplified sgpanel code***;
ods powerpoint close;
For the record. we added options to SGPANEL to control the header border and color starting with version 9.4m3 (NOHEADERBORDER and HEADERBACKCOLOR). It appears that you have 9.4m2, so those options are not available for you until you upgrade.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.