A quick SAS ODS Graphics take on the Flag of France for Bastille Day - third time's the charm!
* Fun With SAS ODS Graphics: Happy Ba(r)stille Day! (vertical bar chart Flag of France)
Based on colors/dimensions at en.wikipedia.org/wiki/Flag_of_France;
data flag; do c=1 to 3; output; end; * Generate flag data - tricolour of blue/white/red;
ods graphics / reset height=4in width=6in antialias; * 2:3 proportion (height:width);
proc sgplot data=flag; * Plot #1: Generate bar chart;
vbar c;
proc sgplot data=flag; * Plot #2: Generate bar chart with colors of Flag of France;
vbar c / colorresponse=c colormodel=(cx0055A4 cxFFFFFF cxEF4135);
proc sgplot data=flag aspect=.66667 noautolegend pad=0 noborder nowall; * Plot #3: Generate bar chart as tricolour Flag of France;
vbar c / barwidth=1 colorresponse=c colormodel=(cx0055A4 cxFFFFFF cxEF4135) nooutline baselineattrs=(thickness=0);
xaxis display=none min=.5 max=3.5 offsetmin=0 offsetmax=0 type=linear; * Suppress axis/padding;
yaxis display=none min=0 max=1 offsetmin=0 offsetmax=0;
run;
BLOCK also can do this simple .
data flag; do c=1 to 3; output; end; run; * Generate flag data - tricolour of blue/white/red;
ods graphics / reset height=4in width=6in antialias noborder; * 2:3 proportion (height:width);
proc sgplot data=flag noautolegend; * Plot #1: Generate bar chart;
styleattrs datacolors=(cx0055A4 cxFFFFFF cxEF4135);
block x=c block=c/novalues nooutline ;
xaxis type=discrete integer display=none offsetmax=0.17 offsetmin=0.17;
yaxis display=none;
run;
@Ksharp - an elegant solution ... but it takes the 'bar' out of Ba(r)stille day! 🙂
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.